How do I find multiple matches with one regular expression?
- by christian studer
I've got the following string:
response: id="1" message="whatever" attribute="none" world="hello"
The order of the attributes is random. There might be any number of other attributes.
Is there a way to get the id, message and world attribute in one regular expression instead of applying the following three one after another?
/ message="(.*?)"/
/ world="(.*?)"/
/ id="(.*?)"/