Please explain this pattern to me.

Theera

Expert
Licensed User
Longtime User
Hi Erel,
I've been understand your this,but I don't understand attached a part of picture which highlighted. Please explain more to me.

P.S. Assume IP=192.168.0.1
 

Attachments

  • patterned.png
    patterned.png
    4.2 KB · Views: 268

Theera

Expert
Licensed User
Longtime User
It is easier to analyze it if you post the string instead of the image. This part means: all characters except dot.

A better pattern would be \d+

Hi Erel,
My picture come from yours ,I've understand your guide,but I don't understand the coding in the picture.

P.S. regex.IsMatch("(\d+).(\d+).(\d+).(\d+)" ,s) when s is Target string
 
Upvote 0

Theera

Expert
Licensed User
Longtime User
Why is it different from anothor one?

Hi Erel,
see this,I think that they are differance.
m = Regex.Matcher("^(\d+)\.(\d+)\.(\d+)\.(\d+)$", ip)

The last has both ^ and $ ,why not be m = Regex.Matcher("(\d+)\.(\d+)\.(\d+)\.(\d+)", ip) And The post #1, The character # is not special character which don't used \.
 
Last edited:
Upvote 0

Theera

Expert
Licensed User
Longtime User
Hi all,
I've found all of data as below already,Thank you once again. see more this,This thread is closed.
 

Attachments

  • found.png
    found.png
    6 KB · Views: 243
Last edited:
Upvote 0
Top