I have another regexp question (seems to be my favorite topic).
I'm trying to parse the output of a cli command, and I'm looking for string, in each output line, that consists of digits seperated by periods. i.e.
but, my problem is, I don't want to capture the output if the 3 field, from the left, is a 0,1,2, or 3. But, it can start with it. I have this snippet:0.1.4.1 0.1.5.2 0.1.6.3 0.1.7.4
But this will not work if the 3rd field is a double digit.if ( /.*(\d+\.\d+\.[4-9]\.\d+).*/ ) { print "$1 <br> \n"; }
So, to elaborate more, the following I want to ignore:
but, these I do want to capture:0.1.1.1 0.1.2.2 0.1.3.3
Basically, if the 3rd field is > 3, I want to capture it.0.1.10.1 0.1.20.2 0.1.30.3
Any thoughts on to do this ???? Thx.
20040519 Edit by Corion: Changed title from 'Another regular expression'
In reply to Question about conditional regex capture by TASdvlper
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |