I need to extract the id pKmuXgem
from the following function (being returned as a string):
"someFunction('Short Description','','pKmuXgem'); return false;"
The id may change, but the surrounding markup should stay the same. I can do a simple string replace:
var str = "someFunction('Short Description','','pKmuXgem'); return false;";
var id = str.replace("someFunction('Short Description','','", "");
id = str.replace("'); return false;", "");
but that feels fragile.
What is best practice?