in reply to Regex match multiple line output
You must check each one. Your result is always 'true' because $output1 is always 'true'.
UPDATE: Consider using Regexp::Common::net to test for IP's.
if ( $output1 =~ m/\d+\.\d+/m or $output2 =~ m/\d+\.\d+/m ) {
Your use of /g is inappropriate.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regex match multiple line output
by bartrad (Beadle) on Feb 20, 2018 at 15:55 UTC | |
by AnomalousMonk (Archbishop) on Feb 20, 2018 at 17:07 UTC |