I am trying to parse this string:
:p0 = ‘R’ [Type: String (0)], :p1 = ‘Y’
[Type: String (0)], :p2 = ‘HBP00’ [Type: String (0)], :p3 = ‘MAG.PF’
and I’ve come up with this expression which works quite well for me:
:p\d*\b\s=\s'\w{1,}'
Basically I am trying to match all the parameters and the values:
- :p0 = ‘R’
- :p1 = ‘Y’
- :p2 = ‘HBP00’
- :p3 = ‘MAG.PF’
but I’ve noticed the expression doesn’t work on :p3 cause of the dot, I reckon.
I don’t seem to be able to find a way to get all the text contained in single quotes.
Thanks for your help.
UPDATE:
I’ve mixed some information I got here and the one which works for me seems to be:
:p\d*\s=\s'[^']+'
I don’t know c# regex syntax very well, but you should either
:p\d*\b\s=\s'[\w\.]+') or,:p\d*\b\s=\s'[^']+')