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
This should work:
var matches = text.match(/\[(\d+)\][(\d+)\]/); var productId = matches[1]; var shopId = matches[2];