views:

50

answers:

2

Hai all

i have a big problem right now

i have this sample code:

preg_match_all("/\[BLOG\=\[(.*)]](.*)\[\/BLOG]/U", $this->soruces , $match_list );

and i don't know why its not will working, its print this out to me

Array ( [0] => GROUPID=23|CATID=28|SORT=ASE [1] => GROUPID=23|CATID=29|SORT=ASE [2] => GROUPID=23|CATID=30|SORT=ASE ) 

normal its will return [0][0] = original code, [1][0] = found 1 code, and [2][0] = found code 2, but why its not working here? can somebody see what i did wrong?

thanks a lot for all help.

+1  A: 

try:

preg_match_all("/\[BLOG\=\[(.*?)\]\](.*?)\[\/BLOG\]/U", $this->soruces , $match_list );

Per Holmäng
Ungreedy modifier *and* ungreedy quantifier?
Gumbo
Oh, didn't see that. I'm obviously way to tired for this.
Per Holmäng
tanks, :) this is one problem the ordre problem is i try to print a wrong var :( tanks for help :D
NeoNmaN
A: 

You could start by escaping the closing square brackets too:

#\[BLOG=\[(.*)\]\](.*)\[/BLOG\]#U

but we need to see the text you're trying to match to tell more.

kemp