Exchange 2010 Transport Rule Regex not working as expected

I'm trying to match a numeric header value to between 300 and 999.

The condition is "when the message header matches text patterns"

I'm using ^(3|4|5|6|7|8|9)\d\d$ based on https://technet.microsoft.com/en-us/library/aa997187%28v=exchg.141%29.aspx

It's working for 300-999, but it's also matching values like 85 and 215.  It seems to match any value with at least 2 digits.

Is my regex correct?  Does regex work correctly for header values?
s-wAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mark BullockQA EngineerCommented:
You don't need the parentheses unless you are replacing the value.
Here is the simplest regex.
[3-9]\d\d

Open in new window


You can test it here.
http://regexr.com/3asi6
0
s-wAuthor Commented:
The [] and - syntax isn't shown as supported for the Transport Rules Regex.  See the Exchange link.  The regex I have works on test sites, it just doesn't work 100% of the time on Exchange.
0
Dan CraciunIT ConsultantCommented:
Doesn't look like Exchange supports ranges, so here is how I think it should work:
^3\d\d|4\d\d|5\d\d|6\d\d|7\d\d|8\d\d|9\d\d$

Try it with like this or with parenthesis:
^(3\d\d|4\d\d|5\d\d|6\d\d|7\d\d|8\d\d|9\d\d)$

HTH,
Dan
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
s-wAuthor Commented:
^(3\d\d|4\d\d|5\d\d|6\d\d|7\d\d|8\d\d|9\d\d)$ works better.  It missed a single 945 over several days.

It's not a fix for what seems to be an Exchange bug, but a reasonable workaround.

Thanks.
0
Dan CraciunIT ConsultantCommented:
You're welcome.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Exchange

From novice to tech pro — start learning today.