danfoxley gmail.com wrote:
> Howdy,
>
> Regex is new to me and trying to parse an NT Event log
for email count.
>
>
> The following is an example of text in the NT Event
log:
> Expected eMails > actual : iEmailsExpected=36,
numEmailMessages=35
>
> I would like to get a match if I get
"numEmailMessages=19" or LESS in
> the NT Event.
If you check only positive numbers without leading zero(like
01, 02),
then you may use:
numEmailMessages=1?\d
> I've come up with the following expression, but the
logic is backwards,
> it comes up with emails 20 or MORE, not 19 or less.
>
> numEmailMessages.(2|3[0-9])
this will match '2' or '30' or '31' or '32' or ....
'39'. If you want
20-39, then:
[23]\d
But if you want to match all integers greater than 19, then:
[2-9]\d|(?!0\d)\d{3,}
\d is a shortcut of [0-9]. (?!0\d) construct is to make
sure no
leading zero.
Good luck,
Xicheng
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regex googlegroups.com
To unsubscribe from this group, send email to
regex-unsubscribe googlegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---
|