0

is there a way to find a matching string which start with "/pathA/pathB/". For example: console.log(matches) for the following string

"/pathA/pathB/c/d" ,"/pathA/pathB/e/f"

but doesn't console.log for the following string

'C/pathA/pathB" or "D/E/pathB/pathA"

I have tried the following

var reg = new RegExp $^(/pathA/pathB) 
if(string.match(reg))
{ console.log("it matches"). }

but couldn't

user21
  • 1,261
  • 5
  • 20
  • 41

0 Answers0