Try this: m/(^\d+\s+\[.*\]).*(SNMP:\s+.*)$/
$1 will contain the indexnumber and the two IP's; $2 will contain the "SNMP:" plus string
Notice how the greediness of the regex-engine allows you to capture from the first [ to the last ] in one go.
CountZero
"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law
In reply to Re: regex needed
by CountZero
in thread regex needed
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |