Hi all,
Ive got quite a tricky one here. Heres the deal:
search : \[(url|URL)\](.*)\[/(url|URL)\]
replace : <a href="(\1)">...</a>
Problem is: when performing it in php sith ereg_replace(), it simply replaces everything between the first occurrence of "[ url ]" and the last one of "[ /url ]" i.e. if there are more than one pseudo-url in the string, it messes up (spaces are added in the quotes for pseudocode reasons).
Side note: when using my text editor, it doesnt mess up. Life is bitter...
What Im looking for: a way to replace my wildcard (.*) with a "not bracket" expression. It succeeded in my text editor
search1: \[(url|URL)\]([^\]]*)\[/(url|URL)\]
but unfortunately not in PHP and I dont know why. I know PHP uses the Posix regexp mechanism. This is wild, Id appreciate some help...
Ive got quite a tricky one here. Heres the deal:
search : \[(url|URL)\](.*)\[/(url|URL)\]
replace : <a href="(\1)">...</a>
Problem is: when performing it in php sith ereg_replace(), it simply replaces everything between the first occurrence of "[ url ]" and the last one of "[ /url ]" i.e. if there are more than one pseudo-url in the string, it messes up (spaces are added in the quotes for pseudocode reasons).
Side note: when using my text editor, it doesnt mess up. Life is bitter...
What Im looking for: a way to replace my wildcard (.*) with a "not bracket" expression. It succeeded in my text editor
search1: \[(url|URL)\]([^\]]*)\[/(url|URL)\]
but unfortunately not in PHP and I dont know why. I know PHP uses the Posix regexp mechanism. This is wild, Id appreciate some help...