Hi Perl Monks
i have a perl script
#!/usr/bin/perl use strict; use warnings; my $output = "ae4.5784 up down inet 182.75.123.121/30"; if($output =~ m/(\d{1,3}\.\d{1-3}\.\d{1-3}\.\d{1-3})$/g) { print "There is an IPdressAd in the output string\n"; } else { print "There is no IPAddress in the output string"; }
My requirement is to check if $output has an IPaddress in it or not. In above example - it contains an IP.
how to give the correct regular expression . The regular expression i have given is not working
In reply to IPAddress check by vasanth.easyrider
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |