简体   繁体   中英

Why is regex not matching on unicode character

So I am trying to write a regex in c# (.NET) to match on a range of unicode characters that could potentially be found in a string. As a simple test, I attempted to match on a single unicode character, \舡, which is the character ”. If I use the regex string "”", I get a match against my test string that contains this character. If, however, I change my regex to "\舡", I don't get a match. Anyone know why this could be and how to get it to work? I have been pulling my hair out over this one. Thanks in advance.

You are not matching the correct character. \\u\u003c/code> requires a character code in hexadecimal . Try \” instead.

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