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
Post a Comment