Hi there!
It´s about omitting numbers again (omit strings of 1-2-digits only and read the longer strings fully).
The precise task: what must we do to omit every string of one or two digits surrounded by space or other non-digit characters)?
With the regular expressions /d and /d/d we can easily omit a string of 1 and 2 digits... but with /d and /d/d only... the longer digit-strings ones are no longer read fully, i.e. 123 will be 3 for example or 232332 will be 2332 (first two digits subtracted)!
Greetings
dinoe
Regular Expression: Digits omitted
Moderator: Jim Bretti
-
- Posts: 1558
- Joined: Wed Oct 29, 2003 11:07 am
- Contact:
Re: Regular Expression: Digits omitted
You can use \D to match characters that are *not* digits. So you might be able to use something like this:
\D\d{1,2}\D
So this expression match one or two decimal digits only when they are not surrounded by other digits.
Does this help?
\D\d{1,2}\D
So this expression match one or two decimal digits only when they are not surrounded by other digits.
Does this help?
Jim Bretti
NextUp.com
NextUp.com
Re: Regular Expression: Digits omitted
Thanks Jim, thats very good