Is there a complete list of regex escape sequences somewhere? I found this, but it was missing \\
and \e
for starters. Thus far I have come up with this regex pattern that hopefully matches all the escape sequences:
@"\\([bBdDfnreasStvwWnAZG\\]|x[A-Z0-9]{2}|u[A-Z0-9]{4}|\d{1,3}|k<\w+>)"
C programming language is a machine-independent programming language that is mainly used to create many types of applications and operating systems such as Windows, and other complicated programs such as the Oracle database, Git, Python interpreter, and games and is considered a programming foundation in the process of ...
In the real sense it has no meaning or full form. It was developed by Dennis Ritchie and Ken Thompson at AT&T bell Lab. First, they used to call it as B language then later they made some improvement into it and renamed it as C and its superscript as C++ which was invented by Dr. Stroustroupe.
C is a general-purpose language that most programmers learn before moving on to more complex languages. From Unix and Windows to Tic Tac Toe and Photoshop, several of the most commonly used applications today have been built on C. It is easy to learn because: A simple syntax with only 32 keywords.
The letter c was applied by French orthographists in the 12th century to represent the sound ts in English, and this sound developed into the simpler sibilant s.
Alternatively, if you only want to escape a string correctly, you could just depend on Regex.Escape()
which will do the necessary escaping for you.
Hint: There is also a Regex.Unescape()
This MSDN page (Regular Expression Language Elements) is a good starting place, with this subpage specifically about escape sequences.
Don't forget the zillions of possible unicode categories: \p{Lu}
, \P{Sm}
etc.
There are too many of these for you to match individually, but I suppose you could use something along the lines of \\[pP]\{[A-Za-z0-9 \-_]+?\}
(untested).
And there's also the simpler stuff that's missing from your list: \.
, \+
, \*
, \?
etc etc.
If you're simply trying to unescape an existing regex then you could try Regex.Unescape
. It's not perfect, but it's probably better than anything you or I could knock up in a short space of time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With