This is the function I've been working on.
public function toWords():void{
var str:String = myRTA.text;
var pattern:RegExp = /\b[A-Za-z0-9'-]+\b/gi;
var result:Array = pattern.exec(str);
while (result != null) {
trace (result.index, result);
result = pattern.exec(str);
}
myDGrid.dataProvider = result;
}
It's close to what I need, but I have two problems.
1) I can't figure out how to modify this to pick up the first word in
the string, if the word is at position 0. I've tried several
modifications to (result != null), with no luck.
2) I can't seem to assign the "result" array to a DataGrid, tree, etc.