Commits

Søren Løvborg committed a20a4a8

Extract $rexTrailPunct subexpression from the $rexUrlLinker regular expression.

Comments (0)

Files changed (1)

 $rexUsername  = '[^]\\\\\x00-\x20\"(),:-<>[\x7f-\xff]{1,64}';
 $rexPassword  = $rexUsername; // allow the same characters as in the username
 $rexUrl       = "$rexProtocol(?:($rexUsername)(:$rexPassword)?@)?($rexDomain|$rexIp)($rexPort$rexPath$rexQuery$rexFragment)";
-$rexUrlLinker = "{\\b$rexUrl(?=[?.!,;:\"]?(\s|$))}";
+$rexTrailPunct= '[?.!,;:"]';
+$rexUrlLinker = "{\\b$rexUrl(?=$rexTrailPunct?(\s|$))}";
 
 /**
  *  $validTlds is an associative array mapping valid TLDs to the value true.