help / php regular expressions

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
$string = "a frist string [[a second string]]";

I want to get in one line of code (using ereg)

$string2 = "a second string";

what is the good regexp ?


Re: help / php regular expressions

Pooxeur wrote:
Quoted text here. Click to load it

Don't know about ereg; using preg_*() is faster and more powerful.
See the manual @

    echo preg_replace('/^.*\[\[(.*)\]\]$/', '', 'one [[two]]');

This script outputs: two

Mail to my "From:" address is readable by all at /
== ** ## !! ------------------------------------------------ !! ## ** ==
may bypass my spam filter. If it does, I may reply from another address!

Site Timeline