2
我有在AS3一對夫婦正則表達式的的與該直列AS3正則表達式語法等被定義:AS3 - 如何正確逃生正則表達式
/\/\*[\s\S]*?\*\//gm
我想將其轉換成在AS3正則表達式類的構造函數,如:
new RegExp('/\/\*[\s\S]*?\*\//', "gm")
我不確定是否必須避開反斜槓。你知道如何轉換它嗎?
/** ------------------------- Regular Expressions ---------------------------- */
public static var multiLineCComments:RegExp = /\/\*[\s\S]*?\*\//gm;
public static var singleLineCComments:RegExp = /\/\/.*$/gm;
public static var singleLinePerlComments:RegExp = /#.*$/gm;
public static var doubleQuotedString:RegExp = /"([^\\"\n]|\\.)*"/g;
public static var singleQuotedString:RegExp = /'([^\\'\n]|\\.)*'/g;
public static var multiLineDoubleQuotedString:XRegExp = new XRegExp('"([^\\\\"]|\\\\.)*"', 'gs');
public static var multiLineSingleQuotedString:XRegExp = new XRegExp("'([^\\\\']|\\\\.)*'", 'gs');
public static var xmlComments:RegExp = /(<|<)!--[\s\S]*?--(>|>)/gm;
public static var url:RegExp = /\w+:\/\/[\w-.\/?%&=:@;]*/g;