简体   繁体   中英

C# regular expression '+' character

How do I use C# regular expressions to search for special characters (like '+' in this case)?

I would usually just use + in perl / ruby, but I can't seem to figure out how to do this in C#. Thanks for any help you can provide.

使用反斜杠转义特殊字符

Backslashes work fine. As an alternative, you could use a character class for this and use [+] to match "+".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM