Reputation: 282845
This compiles and executes:
var re = new Regex(@"what\ever");
But I can't find anything that matches it. whatever
, what\ever
and what\\ever
all fail to match.
\e
isn't a valid escape sequence AFAIK, so I'm not sure what the intended behaviour here is...
Upvotes: 2
Views: 268
Reputation: 4764
I think you should use
var re = new Regex(@"[what\ever]");
to match "what\ever"
Upvotes: -1
Reputation: 11797
It's the escape sequence (0x1B).
See non printable characters section here.
Upvotes: 2
Reputation: 2625
\e is the escape control character
you can use a free tool called The Regulator which has built in intellisense which helps for things like this.
Upvotes: 3
Reputation: 4871
I think \e
matches the "Escape" character (ASCII code 27). Hence it should match "what\x1bver"
Upvotes: 7