php - finding preg_match_all with a lookbehind and lookahead -


i have current line

preg_match_all('/(?<=, ")<b>[\d\d]+(?="\)\;})/',$str,$matches); 

where $str equal to

906), "<b>tadam tadam 393943</b>");});

for reason won't find matches, how that?

update
in order work needed add u @
end of regex, wouldn't greedy...
go figure.

it match, have specify group parentheses:

preg_match_all('/(?<=, ")(<b>[\d\d]+)(?="\)\;})/',$str,$matches); 

so fragment matching <b>[\d\d]+ can accessed via $matches[1][0].


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -