I was wondering how it's possible (if it is) to get multiple elements between text.
For example my test String is <pizza>name:1;John:2</pizza>Carl:8
and I want to get all the Names:number
that are between the <pizza>
tags.
If I use \w+:\d
I get name:1
, John:2
but also Carl:8
.
Is there a way to get only the ones inside the tags? (So only name:1
and John:2
in this case)
I've tried using <pizza>(\w+:\d;)+</pizza>
but it only gives me the last one that's inside.
Thanks in advance!