Here is matches function that I used. The application is after the code.
public static function getMatches(expression:RegExp, stringToMatch:String):Array { if (!expression.global) { throw new Error("expression.global is not true!"); } var matches:Array = new Array(); var allMatchesFound:Boolean = false; while (allMatchesFound == false) { var match:String = expression.exec(stringToMatch); if(match != null) { matches.push(match); } else { allMatchesFound = true; } } return matches; }
No comments:
Post a Comment