Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
reichstein
· 5mo ago · 0 comments
Just because it's my windmill to tilt at: `[\s\S]` can be written shorter and more precisely as `[^]`.
Comments
[–]
MomsAVoxell
5mo ago
[\s\S] vs. [^]
A quixotic windmill tilt if ever I saw one.
[–]
GoToRO
5mo ago
ai says [^] is not portable; I did not test it. Too bad, I'll stick to [\s\S].
[–]
spiesd
5mo ago
Too bad, indeed. It's well-defined in javascript (and thus, appropriate in this admittedly niche context). It's non-portable across different regex engines, yes.
[–]
GoToRO
5mo ago
exactly what I said