I have the following problem, I use this regex in my ruby code, it works perfectly fine in ruby:
^[a-z0-9]+[a-z0-9\.\-_]*$
When I try to match it via JavaScript in my jquery:
$("#foo").val().match("^[a-z0-9]+[a-z0-9\.\-_]*$"))
the . and _ works but not for the -, it simply doesn't match in this case but it should.
Any ideas why this happens? Its already escaped.