Fix url regex (#2815)
Fixed url detection in chat messages. Stops false positives such as `um.....no`
This commit is contained in:
parent
aa672ea69a
commit
5f74a75435
1 changed files with 3 additions and 3 deletions
|
@ -561,9 +561,9 @@ public class ForgeHooks
|
|||
|
||||
|
||||
static final Pattern URL_PATTERN = Pattern.compile(
|
||||
// schema ipv4 OR namespace port path ends
|
||||
// |-----------------| |-------------------------| |----------------------------| |---------| |--| |---------------|
|
||||
"((?:[a-z0-9]{2,}:\\/\\/)?(?:(?:[0-9]{1,3}\\.){3}[0-9]{1,3}|(?:[-\\w_\\.]{1,}\\.[a-z]{2,}?))(?::[0-9]{1,5})?.*?(?=[!\"\u00A7 \n]|$))",
|
||||
// schema ipv4 OR namespace port path ends
|
||||
// |-----------------| |-------------------------| |-------------------------| |---------| |--| |---------------|
|
||||
"((?:[a-z0-9]{2,}:\\/\\/)?(?:(?:[0-9]{1,3}\\.){3}[0-9]{1,3}|(?:[-\\w_]{1,}\\.[a-z]{2,}?))(?::[0-9]{1,5})?.*?(?=[!\"\u00A7 \n]|$))",
|
||||
Pattern.CASE_INSENSITIVE);
|
||||
|
||||
public static ITextComponent newChatWithLinks(String string){ return newChatWithLinks(string, true); }
|
||||
|
|
Loading…
Reference in a new issue