re: regular expression escaping
/**
* Copyright makc3d ( http://wonderfl.net/user/makc3d )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/672D
*/
// forked from wh0's regular expression escaping
package {
import com.actionscriptbible.Example;
import flash.utils.describeType;
public class FlashTest extends Example {
public function FlashTest() {
// Use a regular expression to find \u0064
// something like this:
var re:RegExp = /\\[u]{1}0064/;
trace('source: ' + re.source);
var str1:String = '\\u0064';
trace('test string 1: ' + str1);
trace('should be \\u0064: ' + re.exec(str1));
var str2:String = 'foo5bar';
trace('test string 2: ' + str2);
trace('should be null: ' + re.exec(str2));
}
}
}