|
Posted by Alan on 03/08/07 22:31
"Petra Meier" <mordret@sms.at> wrote in message
news:1173258231.245528.24030@64g2000cwx.googlegroups.com...
> noone has an idea? :(
>
> On Mar 5, 4:57 pm, "Petra Meier" <mord...@sms.at> wrote:
>> Hello,
>>
>> I use the following script to parse URI and email:
>>
<snip>
>> $regexURI = '#(^|[^\"=]{1})(http://|ftp://|https://|news:)([^
>> \s<>]+)
>> ([\s\n<>]|$)#sm';
<snip>
>>
>> I want to have it like this though:
>>
>> A sentence with a link <a href="http://uri.in.senctence.com/
>> foo.html">http://uri.in.senctence.com/foo.html<a/>, and a comma after
>> the link
>>
>> I already invested a lot of time with these regex and didn't succeed.
>> Any of you regex-gurus could help me please! :)
>>
>> Petra Meier
>
>
Petra,
Not a regex-expert, and not absolutely clear from your description exactly
what you want, but for what its worth and as you have had no other reply,
perhaps:-
$regexURI =
'#(^|(?<=>))(http://|ftp://|https://|news:)([^\s]+(htm)l?)?([\.,;:]?|$)#sm';
$repString = "$1<a id=\"external\" name=\"$2$3\">$2$3</a>$5";
--
Alan
[Back to original message]
|