Page 1 of 1
find files
Posted: Mon May 02, 2005 7:13 pm
by skwareks
Hi Guys,
Need some help from WildEdit pros:-)
I need to find all files containing:
<integer name="MaxChars">5</integer>
the trick is I need to find files where the max char is 5 or greater. Does anyone know what I should put in instead of 5 so all files with <5 are not found?
Thanks,
Sebastian
Posted: Mon May 02, 2005 8:12 pm
by s_reynisson
Try something like [5-9]|[0-9][0-9]+
HTH
Posted: Mon May 02, 2005 8:16 pm
by ben_josephs
Don't forget the parentheses to stop the '|' grabbing too much:
([5-9]|[0-9][0-9]+)
Alternatively:
([5-9]|[0-9]{2,})
Posted: Mon May 02, 2005 8:32 pm
by skwareks
first I was getting over 500 replacements in 3 test files where there should be not more than 15.
then I used
<integer name="MaxChars">([5-9]|[0-9]{2,})</integer>
and I got correct count.
Can you please tell me what should I change if next I want to find files with MaxChar =>85
I don't undertand what these numbers represent:
([5-9]|[0-9]{2,})
Thanks!!
Posted: Mon May 02, 2005 9:15 pm
by s_reynisson
Using Ben's solution - ([5-9]|[0-9]{2,}) - you have
() - group the options together
[5-9] - a single character that can be 5, 6, 7, 8 or 9
| - or
[0-9]{2,} - any two or more digits
To grab 85 and up you can use
(8[5-9]|9[0-9]|[0-9]{3,})
() - group the options together
8
[5-9] - followed by a single digit in the 5-9 range
| - or
9
[0-9] - followed by a single digit in the 0-9 range
| - or
[0-9]{3,} - any three or more digits
Posted: Tue May 03, 2005 1:07 pm
by skwareks
Great! Thank You very much!!!