Is there anyway to pick up back-references?
var name = "HELLO WORLD"
var patt = /\S+\s(.+)/;
alert(name.match(patt));
This is just a simple example to get every word after the first.
But, if I alert $1, nothing pops up and I’m not sure why. I’d appreciate any help!
Just a quick solution to this if anyone is actually looking for this.
You can use
RegExp.$XwhereXis the digit of the reference you seek.matchreturns an array as well, which you can use to see whether things matched as well as the backreferences in the following indices.