var patt = path.match(/P[0-9][0-9][0-9]/);
patt = patt.substr(1); //Remove P
while(patt.charAt(0) === '0') { //Remove 0
patt = patt.substr(1);
}
alert(patt);
patt is fixed to this format:
eg. P001 to P999
What I would like to do is very basic, just remove P and the leading 0 (if any). However, the code above is not working. Thanks for helping
Please use it like this: