Hi all,
I've got quite a tricky one here. Here's 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 doesn't mess up. Life is bitter...
What I'm 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 don't know why. I know PHP uses the Posix regexp mechanism. This is wild, I'd appreciate some help...
I've got quite a tricky one here. Here's 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 doesn't mess up. Life is bitter...
What I'm 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 don't know why. I know PHP uses the Posix regexp mechanism. This is wild, I'd appreciate some help...