how I can join these two patterns to fit on a single preg_match_all:
I have this:
preg_match_all("/(<span[^>]*annot[^>]*value=.?(\w*).?[^>]*>)(.*?)<\/span>/", $text, $matches, PREG_OFFSET_CAPTURE);
and this:
preg_match_all("/(<span[^>]*value=.?(\w*).?[^>]*annot[^>]*>)(.*?)<\/span>/", $text, $matches, PREG_OFFSET_CAPTURE);
I need the pattern to look for two things at once
Despite the HTML matching thing, try this:
They are just combined via an
oroperator like this:Edit: If I understood what you are trying to do, matching “annot= value=” and “value= annot=”, you can use this regexp instead (Hope I didn’t mess anything, but you should get the idea):