javascript
RegExp escape:
let text = '/aaa/78/9' let regex = new RegExp('^/[\\w\\d\\.\\-_]+/[^/]+/[^/]*$') console.log(text.match(regex)) /// output: // /aaa/78/9
(ваш голос учтен)
let text = '/aaa/78/9' let regex = new RegExp('^/[\\w\\d\\.\\-_]+/[^/]+/[^/]*$') console.log(text.match(regex)) /// output: // /aaa/78/9