3 ms·
The problem here is simply a bad regex pattern. You need to use something that supports Unicode an enable it. (Usually a flag or option you have to set because
by noxer 6y ago
The problem here is simply a bad regex pattern.
You need to use something that supports Unicode an enable it. (Usually a flag or option you have to set because Unicode matching is slower and often not needed.)
Then last but not least you need to use character classes and not define ranges yourself unless you actually need a range. Like you cant use [:digit:] or \d if you really only want 1-9 without the 0.
Here are some examples to match your string all of them use PCRE flavor
(UCP)[[:alpha:]]+
(UCP)[[:alnum:]]+ This would includes digits
(UCP)[[:word:]]+ This includes "word" chars
(UCP)\w+ same as above