I have regex as /^[a-zA-Z ]+$/ now I need to add support for unicode characters and so am using \p{L} like '/^[a-zA-Z ]+$\p{L}/'.
This is not working for me and I am not sure that this is correct way of using it. I am new to regex and would appreciate any guidance.
Thanks.
Does this help?
This will match any string that consists of spaces and any kind of letter from any language. The
uflag, as Johannes pointed out, makes it match against UTF-8.Also, I have found this site to be a lot of help for Regular Expressions in general. The link I’ve provided talks about regular expressions and unicode characters.