Artificial intelligent assistant

egrep regular expression for times over five minutes I have the following time formats in a text file `1` equals one second. `5|01` equals five minutes and one seconds. `13|01` equals thirteen minutes and one seconds. `21|12|01` equals 21 hours, 12 minutes, and 1 seconds. I need to egrep for any times over five minutes. I'm using the following regex but it doesn't work because it excludes times such as `13|00`. '[[:space:]0-9][[:space:]0-9][[:space:]|][[:space:]0-9][[:space:]6-9][|][0-9][0-9]' Here's an example: lite on 1 lite on 01 lite on 5|22 lite on 23|14 lite on 1|14|23

Ignoring the spaces (which you can fill in yourself later) and possible leading zeros (likewise), you're looking to match any of


[5-9]\|[0-9]+
[1-9][0-9]\|[0-9]+
[0-9]+\|[0-9]+\|[0-9]+


for times in the range


[5,10) minutes
[10,99) minutes
1+ hours


respectively.

So join those together in a match group `(...|...)` with sufficient anchoring at the beginning and end (so you don't match on `14|59` or `1|00|00`).

This gives


grep -E 'on +([5-9]\|[0-9]+|[1-9][0-9]\|[0-9]+|[0-9]+\|[0-9]+\|[0-9]+) *$'


We can simplify a little, because the seconds are common to all three regexps:


grep -E 'on +([5-9]|[1-9][0-9]|[0-9]+\|[0-9]+)\|[0-9]+ *$'

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 4dd19b4996e3378254a970341f2c436f