Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • 4
    This fails for international characters(chinese, arabic etc).I wouldn't use it. Commented Apr 23, 2014 at 11:31
  • == true? Wouldn't if(regex.test(str)) { [...] } suffice? Commented Oct 23, 2015 at 0:48
  • Of course it would @scniro. I just put the entire equation for clarity sake. Commented Oct 23, 2015 at 11:36