More generally, why is the regular expression engine in Exchange so
atrociously poor?
Since there is no tester for whatever flavor it is that Exchange uses,
I'm using a rule that applies to the Subject, and adds a header when it
matches.
Thanks.
Michael
"user...@domain.com" -match <pattern>
The pattern ^<*use...@example.com>*$ is an example of what I'm trying to
match in this case (an email address with or without angle brackets).
However, it does not appear that that pattern operates as described in
the Exchange help--it matches everything. Is this a bug or am I missing
something in my interpretation of Exchange's regular expression facility?
> As to testing your matching, you can simply use PowerShell to test:
>
> "user...@domain.com" -match <pattern>
Are you referring to Select-String? I don't think that can test an
Exchange regular expression since Select-String uses .NET regular
expressions. Or is there another command that can be applied against
the Exchange version?
Thanks Steven.
Michael
More generally, why is the regular expression engine in Exchange 2007 so
atrociously poor?
Also, is there a regex tester available? In lieu of one, I'm using a
rule that applies to the Subject, and adds a header when it matches. Is
there a more efficient way?
Thanks.
Michael
>Why does "^<*use...@example.com>*$" (no quotes) match everything?
No idea.
>More generally, why is the regular expression engine in Exchange 2007 so
>atrociously poor?
I can only guess that they thought a real RegEx engine would be too
slow (and I've certainly seen RegEx that would slow down even the
fastest engine!) to keep up with the number of patterns to match
against every message.
>Also, is there a regex tester available?
For E2K7? None that I know of. I suppose you could just use
Powershell.
--
Rich Matheisen
MCSE+I, Exchange MVP
MS Exchange FAQ at http://www.swinc.com/resource/exch_faq.htm
Don't send mail to this address mailto:h.p...@getronics.com
Or to these, either: mailto:h.p...@pinkroccade.com mailto:melvin.mcp...@getronics.com mailto:melvin.mcp...@pinkroccade.com
So it's a bug? Should I report it, and if so, to whom?
>> Also, is there a regex tester available?
>
> For E2K7? None that I know of. I suppose you could just use
> Powershell.
Can you give an example of how I would test say, the above regex with
Powershell? Doesn't it use the .NET regex engine or is there a way to
make it use the Exchange version?
Thanks.
Michael
Just a simple example:
get-user <primary-proxy-address> | where {$_.WindowsEmailAddress
-match "^<*use...@example.com>*$"