change RegEx in filter_url for text field I have nodes with text field containing URLs. The content is imported from XML file. The URLs are converted to links with drupals filter system, which works fine for most of the links but not all. I guess its the regex in filter_url function, but I can't figure it out.

Example URL:

http://example.net/2027/uc1.$b81009?urlappend=%3Bseq=7


is converted to

&lt;a href="http://example.net/2027/uc1"&gt;http://example.net/2027/uc1&lt;/a&gt;.$b81009?urlappend=%3Bseq=7


I'm not a php expert but I'm trying to fix this issue with a custom module. I copied the function _filter_url to mymodule.module, renamed it to mymodule_filter_url. Invoking hook_filter_info_alter(&amp;$info) I change the process callback:

$info['filter_url']['process callback'] = 'mymodule_filter_url';


Now I have to find the regex expression, which stops the URL encoding right before the '.$'. I guess it's in one of these lines:

$trail = '[a-zA-Z0-9:%_+*~#&amp;\[\]=/;?!\.,-]*[a-zA-Z0-9:%_+*~#&amp;\[\]=/;-]';
$punctuation = '[\.,?!]*?';


But here I'm stuck. Can someone help me?
I think, I got the answer. I added "\$" to the $trail RegEx pattern.

$trail = '[a-zA-Z0-9:%_+*~#&amp;\[\]=/;?!\.,\-\$]*[a-zA-Z0-9:%_+*~#&amp;\[\]=/;-]';


Are there any drawbacks with this solution or is there a better way solving it?