I have a string being received from a monitoring system, the string contains 3 variables that I am interested in the variables are pre/post fixed with c=VAR1; e=VAR2; s=VAR3; so I want to grab the text in between for example c= ; but am having limited success, these are a few of the REGEXs I have tested with:
c=([^;]+);
.+c=(.+);.+
(?<=c=\()(.*?)(?=\;*\))
c=(.*);
A full alert string would look similar to:
alert c=Vari Able1; e=Vari Able2; s=Vari Able3;
But none seem to return in the way I would expect.
Any help is much appreciated.
Thanks!
You can use something like:
Which would grab all values (key and value), but if you’re after only the c value:
Should capture everything between the
=and;(([^;]+)captures every character that’s not a semi-colon, repeated 1 or more times.).