Given the following string: 's0\\8\\26\\29\\30\\32' or 's0\\8\\26\\' or 's0\\5', I need to return the last digits of the string.
Given:
function getFolderID(mystr) {
var reFolderID = /\bs0\\\\[0-9]+\b/g //regexp to return s0\\34
var retArr = [];
var retval = '';
retArr = mystr.match(reFolderID);
retArr = retArr[0].replace(/s0\\\\/g, "");
if (retArr != null) {
retval = retArr[retArr.length - 1];
}
//alert("Ret: " + retval);
return retval;
}
At first I thought I just needed the first digits, but turns out I need the last ones.
What would the proper regexp term be for this?
Also, how can I create an ASP.Net event handler to do something with the returned JS value?