标签: javascript regex
var isbn = '978-0393317558'; alert(isbn.replace(/^[^0-9]+/, '')); //this gives the same value
为什么不更换破折号?
答案 0 :(得分:4)
因为第一个^强制匹配位于字符串的开头。
^