2009-11-29 4 views

Répondre

5
var string:String = "something 'is' \\fishy here"; 
trace(string);//something 'is' \fishy here 
string = string.replace(/(['\\])/g, "\\$1"); 
trace(string);//something \'is\' \\fishy here 
2

La réponse d'Amarghosh est sur place. Si vous voulez un moyen facile de tester regex AS3, Grant Skinner's Regexr est génial.

Questions connexes