You can use alternatives and repeat counts to define a search pattern for numbers greater than 45.
This solution assumes the numbers are integer numbers without a decimal point.
grep 'IO resumed after \(4[6-9]\|[5-9][0-9]\|[0-9]\{3,\}\) seconds'
or shorter with egrep
:
egrep 'IO resumed after (4[6-9]|[5-9][0-9]|[0-9]{3,}) seconds'
I tested the pattern with
for i in 1 10 30 44 45 46 47 48 49 50 51 60 99 100 1234567
do
echo "foo IO resumed after $i seconds bar"
done | grep 'IO resumed after \(4[6-9]\|[5-9][0-9]\|[0-9]\{3,\}\) seconds'
which prints
foo IO resumed after 46 seconds bar
foo IO resumed after 47 seconds bar
foo IO resumed after 48 seconds bar
foo IO resumed after 49 seconds bar
foo IO resumed after 50 seconds bar
foo IO resumed after 51 seconds bar
foo IO resumed after 60 seconds bar
foo IO resumed after 99 seconds bar
foo IO resumed after 100 seconds bar
foo IO resumed after 1234567 seconds bar
If the numbers (can) have a decimal point, it is difficult to define a pattern for numbers > 45, e.g. 45.1
.
This pattern allows a decimal point or comma followed by digits and implements a condition >= 46.
grep 'IO resumed after \(4[6-9]\|[5-9][0-9]\|[0-9]\{3,\}\)\([.,][0-9]*\)\{,1\} seconds'
2nd edit:
The patterns above don't handle possible leading zeros. As suggested by user kvantour in a comment, the pattern can be extended to handle this. Furthermore, if it is not required to check the seconds
part, the pattern for the decimals can be omitted.
Pattern for numbers >= 45 with optional leading zeros:
grep 'IO resumed after 0*\(4[5-9]\|[5-9][0-9]\|[1-9][0-9]\{2,\}\)'