in reply to Question about conditional regex capture
update: I missed the fact that the string of digits with periods needs to be extracted from a line of additional text. The solution I posted below would only work once you have already extracted the digit/period string.
# why use a regex? splitting is enough while ( <DATA> ) { print $_ if ( (split( /\./ ))[2] > 3 ); } __DATA__ 0.1.1.1 0.1.2.2 0.1.3.3 0.1.10.1 0.1.20.2 0.1.30.3
|
|---|