B2G/gecko/toolkit/webapps/WebappsInstaller.jsm
/**
 * Strips all non-word characters from the beginning and end of a string
 */
Strips all non-word characters from the beginning and end of a string
Strips all non - word characters from the beginning and end of a string
function stripStringForFilename(aPossiblyBadFilenameString) {
  let stripFrontRE = new RegExp("^\\W*","gi");
  let stripBackRE = new RegExp("\\s*$","gi");
  let stripped = aPossiblyBadFilenameString.replace(stripFrontRE, "");
  stripped = stripped.replace(stripBackRE, "");
  return stripped;
}
function stripStringForFilename ( aPossiblyBadFilenameString ) { let stripFrontRE = new RegExp ( "^\\W*" , "gi" ) ; let stripBackRE = new RegExp ( "\\s*$" , "gi" ) ; let stripped = aPossiblyBadFilenameString . replace ( stripFrontRE , "" ) ; stripped = stripped . replace ( stripBackRE , "" ) ; return stripped ; }
Strips all non-word characters from the beginning and end of a string
Strips all non - word characters from the beginning and end of a string
//strip everything from the front up to the first [0-9a-zA-Z]