Hacker News new | ask | show | jobs
by mutation 4961 days ago
It doesn't. Space is significant here, and if '-' is a the front of the matching character class it matches literal '-'. Your regex '[- ~]' matches either '-' or ' ' or '~'.