List operator on multiple character classes without using matching group

Viewed 21

I want to extend the regular expression [a-z0-9] to become Unicode-inclusive. [a-z] becomes \p{Ll} or [:lower:] and [0-9] becomes \d or [:digit:]. But what does [a-z0-9] become? I know that you can express it as (\p{Ll}|\d). But I don't want to introduce another matching group into my expression. So can I express [a-z0-9] in a Unicode-inclusive manner without using a matching group?

1 Answers

There is no specific construct/shorthand for lowercase letters and digits.

You need to create your own character class for that:

[\p{Ll}\p{N}]
[[:lower:][:digit:]]
Related