Super Dave 26 Posted July 19, 2010 Report Share Posted July 19, 2010 var raw = '{1}'; var matches = raw.match(/\(?(\d{3})\)?[- ]?(\d{3})[- ]?(\d{4})/g); if ( matches != null) { alert(matches[0]); } I'm trying to match a phone number in many formats. I've worked very hard to figure that regex out and tested it with different sandboxes http://gskinner.com/RegExr/ http://www.pagecolumn.com/tool/regtest.htm Ubot throws an error that doesn't give much explanation, just the text from my code (shown above). Anyone able to shed some light on this? Quote Link to post Share on other sites
Seth Turin 223 Posted July 20, 2010 Report Share Posted July 20, 2010 what kind of error does it throw? Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.