Skip to content

Comment on Regex Isn't Hard (2023)parent

Comments

I've also seen people use `[\s\S]` to match all characters when they couldn't use `.`.

This is a common approach when the regex needs to match any character including newlines; `.` often doesn't.

I generally use `[^]`

Also you can use . with the dotAll /s

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.