1
votes

VBA Regular Expressions character groups do not support unicode character groups (e.g. {p(L}). Also \w matches only latin alphanumerics. So my problem was how to replace non alphanumeric characters from my unicode string without typing the whole characters' list in pattern field.

For example, trying to replace with underscore every non word character in "abc (for αβψ̌) and de (for δε)", with pattern \W results in "abc__for_______and_de__for____" instead of abc__for_αβψ___and_de__for_δε_

Finally I think there is at least one quick solution...

1

1 Answers

1
votes

An approach is to find the unicode first and last character in range and use it as character range. With the pattern [^\w,\u0370-\u03FF\u1F00-\u1FFF] I can get rid of any non-latin or non-greek alphanumeric character. Also we can use this pattern in the excel function RegExReplace