Does regex work when I translate them into another language?

For example:, @"^\s*([a-zA-Z]*)\s*$"this is a regular expression,

Now I translated this expression into Chinese: @"^\小號*([一-ž一-ž]*)\小號*$"

Will it work (always)?

+3
source share
2 answers

I really doubt. Now I don’t know Mandarin, Cantonese or any other “Chinese” language, so I can’t say what these “translations” mean. But I'm sure you cannot just transliterate ASCII escape sequences to Chinese characters.

\sis a reduction in spaces. I'm sure \小號not.

[A-Z] " A Z. , [一-ž] , ž, .

+2

, , , RegEx.

, RegEx (, PCRE flavor .NET flavor, (?<=\w+),. PCRE engine , .NET engine .). ?

, [a-z] 97 (dec) 122 (dec) 65 (dec) 90 (dec), case-insensitive. \p{L} ( LETTER), .

+1

All Articles