How to write this regular expression? Experts Help reply to the discussion (solution)
$ Str = "[size = 18 px] 123 [size = 16px] 456 [/size] 789 [/size]";
Preg_match_all ('# \ [size = [^ \ [\] + \] (? : [^ \ [\] + | ((? R) * \ [/size \] # ', $ str, $ matchs );
Print_r ($ matchs );
$ Str = "[size = 18 px] 123 [size = 16px] 456 [/size] 789 [/size]";
Preg_match_all ('# \ [size = [^ \ [\] + \] (? : [^ \ [\] + | ((? R) * \ [/size \] # ', $ str, $ matchs );
Print_r ($ matchs );
Great God !!! Too Good. it takes some time to digest it.
$ Str = "[size = 18 px] 123 [size = 16px] 456 [/size] 789 [/size]";
Preg_match_all ('# \ [size = [^ \ [\] + \] (? : [^ \ [\] + | ((? R) * \ [/size \] # ', $ str, $ matchs );
Print_r ($ matchs );
Great God !!! Too Good. it takes some time to digest it.
$ Str = "[size = 18 px] 123 [size = 16px] 456 [/size] 789 [/size]";
Preg_match_all ('# \ [size = [^ \ [\] + \] (? : [^ \ [\] + | ((? R) * \ [/size \] # ', $ str, $ matchs );
Print_r ($ matchs );
Great God !!! Too Good. it takes some time to digest it.
Irrigation ..
Don't underestimate what I wrote. The answer is exactly what you want.
$str = "123[size=16px]456789[/size]";$pattern = '/\[size=18px\]123(.*?)789\[\/size\]/';preg_match_all($pattern, $str, $arr);print_r($arr);