Wednesday 15 July 2015

.NET RegEx Patterns (Instagram URL Pattern) -


I am reading about the .NET Regular Expression on MSDN. I am stunned when I am possessed and speechless. I do not know what the pattern should be to remove the URL below. Can anyone help someone with the knowledge of NAT general expression? Thank you.

This is an example of a URL on which I am trying to use a pattern:

img src = "http://distilleryimage4.s3.amazonaws.com/ A0a2f13eda3c11e2b7ba22000aaa2161_6 .jpg

The only constants of these URLs are 'img src = "http: //', '.com', other '/' and '_6.jpg'. Among the other characters, all will be alphanumeric and will be decimals. '

Instead of using regular expressions to parse URL -s, instead of class Use it to have the reading properties for each part of the URL and it will parse properly.

If you start to handle various different URLs and you have a hard time testing all the different possibilities.

For example:

  string sUrl = "http://distilleryimage4.s3.amazonaws.com/a0...a2161_6.jpg"; Uri Oural;     (Use the properties of Oural to inspect the URI)    

No comments:

Post a Comment