You need to capture:
if($string =~/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/{ $ip = $1; }
See Capture Groups.
In reply to Re: print ip address from string using regex
by AR
in thread print ip address from string using regex
by flyganji
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |