Reply To: Find a number bigger than

#75912

Comparing numbers for size with GREP is a dark art and best avoided whenever possible. Justin is right: trying to solve your problem (barely mentioned so far; but there are scripts to adjust numbers!) with GREP leads to the adage “now you got two problems”.

Anyway, I’ll have a go at it, just for the fun of it :D

(?![012]\d{3})\d{4,}

This find series of 4 digits or more, but if there are only 4 it will ignore them if they start with “0”, “1”, or “2”. The addition of “0” in this sequence will make it ignore “0123” as well – you may consider that a bonus.

This article was last modified on June 9, 2015

Comments (0)

Loading comments...