hi, I'm a regex beginer and I want to know if with backreferences \1 I can reduce the ip test regex that I found on a web site :
By something like that :
I ask that in aim of understand backreferences thank you for answer me.
(@^_^@)
Code:
\b (25[0-5] |2 [0-4] [0-9]| [01]? [0-9][0-9]?)\. (25[0-5] |2 [0-4] [0-9]| [01]? [0-9][0-9]?)\. (25[0-5] |2 [0-4] [0-9]| [01]? [0-9][0-9]?)\. (25[0-5] |2 [0-4] [0-9]| [01]? [0-9][0-9]?)\b
Code:
\b (25[0-5] |2 [0-4] [0-9]| [01]? [0-9][0-9]?)\.)\1\1 (25[0-5] |2 [0-4] [0-9]| [01]? [0-9][0-9]?)\b?
(@^_^@)
Comment