What matches this regex?
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 behaviou开发者_StackOverflow中文版r here is...
I think \e
matches the "Escape" character (ASCII code 27). Hence it should match "what\x1bver"
\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.
\e
is usually equal to \033
.
It's the escape sequence (0x1B).
See non printable characters section here.
I think you should use
var re = new Regex(@"[what\ever]");
to match "what\ever"
精彩评论