Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 416639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T18:30:01+00:00 2026-05-12T18:30:01+00:00

I have a datagrid and a search field. I’ve set the change event of

  • 0

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;
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T18:30:01+00:00Added an answer on May 12, 2026 at 6:30 pm

    I got it! What I wanted to do was to use the “match” function, which is a method of the String object that can take a regular expression as the pattern being matched. So, in order to match items in the dataGrid with a case-INsensitive version of the searchInput.text, I used the following code (matching against the first and last name values of the dataGrid)

    private function usersFilter(item:XML):Boolean {
        var searchResult:XMLList;
        var myTest:RegExp = new RegExp(searchInput.text,"i");
        searchResult = item.(firstName.match(myTest)||lastName.match(myTest));
        if (searchResult.length() > 0) {
            return true;
        } else {
            return false;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a datagrid and I want to set the value of a dropdownlist
I'm using the WPF Toolkit's DataGrid to display a set of search results. As
I have a DataGrid displaying search info that is created and appended to my
QI have a jQuery function that causes my datagrid search results to be scrollable.
I have a working dataset and datagrid already in my project, but I want
I have implemented a simple search function that highlights a row in a DataGrid
I have a DataGrid for search results, that I want the user to be
I have a Form1 , which contains a DataGrid , and a button Search
I have datagrid whichs items source is domainDataSource. How i can refresh Domain data
I have a datagrid in C#.net I have made some columns in grid editable.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.