miguelisboa
Technical User
i got the following from a book:
its a regex that works IF the word(s) dont have any special chars, like:
página, or
maçã
here it is:
$texto = ereg_replace('\[L]([-_./a-zA-Z0-9!&%#?+,\'=:~]+)\[EL]','<a class="texto" href="\\1">\\1</a>', $texto);
$texto = ereg_replace('\[L=([-_./a-zA-Z0-9!&%#?+,\'=:~]+)]'.
'([-_./a-zA-Z0-9 !&%#?+$,\'"=:;~]+)\[EL]',
'<a class="texto" href="\\1">\\2</a>', $texto);
see this example:
visit this [L=[URL unfurl="true"]http://www.tek-tips.com[/URL]] página[EL]
what is missing there ?
note: it works if i use "pagina" instead of "página"
Thanks in advance
its a regex that works IF the word(s) dont have any special chars, like:
página, or
maçã
here it is:
$texto = ereg_replace('\[L]([-_./a-zA-Z0-9!&%#?+,\'=:~]+)\[EL]','<a class="texto" href="\\1">\\1</a>', $texto);
$texto = ereg_replace('\[L=([-_./a-zA-Z0-9!&%#?+,\'=:~]+)]'.
'([-_./a-zA-Z0-9 !&%#?+$,\'"=:;~]+)\[EL]',
'<a class="texto" href="\\1">\\2</a>', $texto);
see this example:
visit this [L=[URL unfurl="true"]http://www.tek-tips.com[/URL]] página[EL]
what is missing there ?
note: it works if i use "pagina" instead of "página"
Thanks in advance