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

It makes the preceding * less "greedy". I don't think it has any effect on the set of strings matched by this regexp, though, which is a simple string suffix check.


I agree, but the dot should be escaped because it matches any character, so "@domain\.com$" should just works for.


Or use [.] so it's super clear on the a-human-is-reading-it parse.


I don't think that's clearer because for [.] I need to remember that . does not need to be escaped in character classes whereas \. is quite clearly an escaped literal character without any advanced regexp knowledge.




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

Search: