The pattern and text are shown online https://regex101.com/r/aL5dD4/2 The pattern should find node values of span elements that are located between code tags.
Text is as follows:
<code>
<div>
<span ds = 'dsds'>12 3 ->;:4</span><span>abc</span>
</div>
</code>
Regex pattern is as follows:
/(?<=<code>).*?<span[^>]*?>(.*?)(?=<\/span>.*?<\/code)/gs
I need it to match both node values 12 3 ->;:4
and abc
.
But only the first is found.
How to get this? Thank you.
.*?]*?>(.*?)(.*?)`](https://regex101.com/r/xT8tH5/1)
– HamZa Jun 24 '16 at 16:14