How to use regular expressions?

-4

I have a string with this value:

  

Romania, "" PROXY_IP ":" 93.118.243.19 "," PROXY_LAST_UPDATE   Indonesia "," PROXY_IP ":" 117.102.88.121 "," PROXY_LAST_UPDATE   Russia "," PROXY_IP ":" 194.135.97.178 "," PROXY_LAST_UPDATE   Malaysia, "PROXY_IP": "192.228.193.78", "PROXY_LAST_UPDATE

and find all parts with "" PROXY_IP ":" XXX.XXX.XXX.XXX "" Code I've tried:

static Regex ipR = new Regex(@""PROXY_IP":"\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}"");

But it was all red ... I do not know how to make Regex search by quotation marks in the middle of the string too

    
asked by anonymous 06.09.2018 / 03:19

1 answer

1

To use quotation marks in a Regex, you need to use the backslash (\). That is, your regex would look like this:

(\"PROXY_IP\":\"\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}\")

There are some very good websites teaching regex and they are interactive. Take a look at the RegExr , I created an example using your case.

    
06.09.2018 / 07:00