Accept '.' in regexp
Preetam opened this issue · comments
Why would periods be a bad idea?
Somewhat related, I'd stick the regex in single quotes so that you don't have to double escape everything. Also, you can simplify that regex bit. This should be equivalent.
>[\w-]+because
\dis included in
\wand you don't have to escape
-. If you want the dot, you don't have to escape it within square brackets because it only means "match all" outside of brackets. So this:
>[\w-_.]+would match
>1-under_score.10but it correctly would not match
>@at_is_bad`.
I agree. I borrowed that code and didn't change it because I thought the original author wrote it that way for certain reasons. :)
I think the original author wasn't fluent in regexp :)