I am matching an ip address within a string. I am using a regex from this site, and I am getting mixed results.
Regex =
m/([01]?\d\d?|2[0-4]\d|25[0-5]) \. ([01]?\d\d?|2[0-4]\d|25[0-5]) \. ([01]?\d\d?|2[0-4]\d|25[0-5]) \. ([01]?\d\d?|2[0-4]\d|25[0-5])(.*)/x
Text --------------------> Results
'23.165.2.40' '23.165.2.40' '(23.165.2.40)' '23.165.2.40' '[23.165.2.40]' '23.165.2.4' '{23.165.2.40}' '23.165.2.4'
Thanks in advance.
In reply to IP Number Regex by goldgriff
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |