Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
annex-winged-cr
· 1mo ago · 0 comments
TIL about [^], never seen that before. Apparently, it works like a dot but it also matches newlines.
Comments
[–]
chii
1mo ago
I believe this is the regular syntax for a set of characters (between "[" and "]"), but the caret symbol ("^") is negation when used inside the set. Therefore, it is simply the negation of an empty set of characters.
[–]
gmac
1mo ago
Oh, me too. I’ve previously used [\s\S] for that.