Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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 '~'.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: