in reply to Question regarding a regex
No, the caret only negates the character set if it appears immediately after the left square bracket. Outside square brackets, it matches the beginning of the string or immediately after a newline. Also: the -~ sequence inside square brackets means 'any character between space and tilde, inclusive.'
So in words, the regular expression specifies 'all characters in the first 4096 (or end-of-file, whichever comes first) are "\r", "\n", "\t", or characters in the range space to tilde, inclusive, in your machine's native encoding'.
Off-topic comments:
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Question regarding a regex
by AnomalousMonk (Archbishop) on Jul 23, 2021 at 00:05 UTC |