Home:ALL Converter>Removing/Replacing multiple special character in filename using RegEx in flex

Removing/Replacing multiple special character in filename using RegEx in flex

Ask Time:2013-03-15T12:38:43         Author:Jacx Toi

Json Formatter

I want to remove or replace special character in file name.

Heres my code, it works in replacing single special character.

// Remove special characters from the name.
var excludeChars:RegExp = /&/gi;
var revisedname:String=new String();

revisedname=newname.replace(excludeChars,"");
newname=new String();
newname=revisedname;

//sample Output: &filename --> filename

but how to do this in replacing multiple special character using RegExp. How to declare multiple RegEx.

for example:

// &file%name# --> filename

Please help. Thanks

Author:Jacx Toi,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/15424859/removing-replacing-multiple-special-character-in-filename-using-regex-in-flex
yy