List Info

Thread: Help With Expression




Help With Expression
user name
2006-08-20 21:05:48
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.

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])

Any help will be appreciated.

Thanks,
Dan Foxley


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to
regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---

Help With Expression
user name
2006-08-21 00:53:51
danfoxleygmail.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 regexgooglegroups.com
To unsubscribe from this group, send email to
regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---

Help With Expression
user name
2006-08-24 07:06:11
Xicheng,
Thanks for the response, I'll try it.

Thanks,
Dan


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to
regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )