Is it possible in JavaScript to do something like preg_match does in PHP ?
JavaScript
preg_match
PHP
I would like to be able to get two numbers from str
var myregexp = /\[(\d+)\]\[(\d+)\]/; var match = myregexp.exec(text); if (match != null) { var productId = match[1]; var shopId = match[2]; } else { // no match }