In .NET, \p{L}
matches any ascii or non-ascii letter (so it will match both a
and ü
).
http://www.regular-expressions.info/unicode.html#prop
Is there a Vim equivalent for this?
In Vim \a
or \w
will only match characters in range [a-z]
(or [0-9A-Za-z_]
).
The regular expression represents all printable ASCII characters. ASCII code is the numerical representation of all the characters and the ASCII table extends from char NUL (Null) to DEL . The printable characters extend from CODE 32 (SPACE) to CODE 126 (TILDE[~]) .
To match a character having special meaning in regex, you need to use a escape sequence prefix with a backslash ( \ ). E.g., \. matches "." ; regex \+ matches "+" ; and regex \( matches "(" . You also need to use regex \\ to match "\" (back-slash).
You can explicitly tell vim which ranges of hex values to match. This is kind of a shotgun approach, but if you know what the possible ranges (like UTF-8 for example) this would work:
/[\x7f-\xffa-zA-Z]
You can also search for explicit unicode values by entering in the unicode character directly or it's code in the following format:
/\%u0300
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