Match Unicode characters except three with regular expressions

I need to get a regular expression that matches all Unicode control characters except for carriage return (0x0d), line (0x0a) and tab (0x09). Currently my regex is as follows:

/\p{C}/u

I just need to identify these three exceptions now.

+3
source share
1 answer

I think you can use a negative result here, combined with character classes.

/(?![\x{000d}\x{000a}\x{0009}])\p{C}/u

lookahead, , , . , .

perl .

(, , , .)

+6

Source: https://habr.com/ru/post/1711864/


All Articles