Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET regular expression reserved characters

Tags:

.net

regex

Where is the set of .NET regular expression reserved characters?

Edit: This looks like it might be it. Thanks sugarman. http://msdn.microsoft.com/en-us/library/az24scfc.aspx

like image 894
H2ONaCl Avatar asked Sep 11 '25 18:09

H2ONaCl


1 Answers

You should look at Regex.Escape(). You pass the function a string and it will escape any reserved regex characters to be interpreted as literals. Credit to this answer goes to Gabe who commented on the OP's post, I'm just making it an answer so others don't possibly miss it.

like image 129
Jarrod Christman Avatar answered Sep 13 '25 13:09

Jarrod Christman