I have a datagrid and a search field. I've set the change event of the search field to run the filterfunction of the datagrid. I'm able to match the entire term, but I'd like to be able to use a regular expression to do a progressive search (e.g., "Pe" matches "Peter"). I tried to create a regular expression to compare the fields, but I can't seem to get it to work. How do I return the results of the RegExp? Here's the function as it currently stands
private function usersFilter(item:XML):Boolean {
var searchResult:XMLList;
var searchCheck:RegExp = /[^a-zA-Z]*/
var searchTerm:Object = searchCheck.exec(searchInput.text);
searchResult = item.(firstName==searchTerm.result);
if (searchResult.length() > 0) {
return true;
} else {
return false;
}
}