The original regex wouldn't match URLs that only have one character before .xxx, such as x.com. I simply add a ? after [\d\w] to make the regex accept domain names started with a single character.
Since Twitter registered x.com as its alternative domain name, many people would use links starting with x.com, and AntiLinks would fail to remove such links (Thanks, Elon!)
Not sure if this change would break other URL matching, but I tested with some other links without encountering any problems.
The original regex wouldn't match URLs that only have one character before .xxx, such as x.com. I simply add a
?
after[\d\w]
to make the regex accept domain names started with a single character.Since Twitter registered x.com as its alternative domain name, many people would use links starting with x.com, and AntiLinks would fail to remove such links (Thanks, Elon!)
Not sure if this change would break other URL matching, but I tested with some other links without encountering any problems.