Page 1 of 1

RegEx for range search

Posted: Fri May 01, 2009 3:54 pm
by ravilobo
Is it possible to have RegEx for a range? For e.g. how to write a RegEx that searches numbers falling between 50 and 75?

Posted: Fri May 01, 2009 6:22 pm
by ben_josephs
In the general case, no. Regular expressions can't do arithmetic. But in your specific case it's not too hard:
\<([56][0-9]|7[0-5])\>

This assumes you are using Posix regular expression syntax:
Configure | Preferences | Editor

[X] Use POSIX regular expression syntax

Posted: Fri May 01, 2009 6:38 pm
by ravilobo
Got your point. Thank you Ben.