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 8815043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:16:38+00:00 2026-06-14T04:16:38+00:00

I am using regular expressions for performing site search. If I search for this

  • 0

I am using regular expressions for performing site search.
If I search for this : “Villas at Millwood” (this is a community name) and the corresponding community name is “Villas at Millwood” , I get the results.

If I search for “Millwood villas” , there are no results populated.

I mean, the phrase is taken as a whole, and matched. Is there any way to match the any occurance of individual words in the entered phrase? so that “millwood Villas” would still bring the result of
“Villas at Millwood” ?

Here is what I have to match the community name :

Regex.IsMatch(MarketingCommunityName.Trim(), pattern, RegexOptions.IgnoreCase)

where pattern is the entered search phrase and the MarketingCommunityName is the actual community name.

Thanks in Advance!

  • 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-06-14T04:16:39+00:00Added an answer on June 14, 2026 at 4:16 am

    Although I think that you should Split your search pattern at a space, and then check every word separately, it would not be too hard to construct an order-independent regular expression from your search pattern:

    var searchWords = searchString.Trim().Split(new Char[] {' '});
    
    string pattern = @"^(?=.*" + String.Join(@")(?=.*", searchWords) + ")";
    

    This constructs a regex that contains one lookahead assertion per search word. Each lookahead assertion starts from the beginning of the string and looks whether the search word shows up anywhere inside the string. Note that you will likely get problems, if your searchString contains regex meta-characters, so these should probably be escaped beforehand.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using regular expressions in C#, is there any way to find and remove duplicate
I'm currently using regular expressions to search through RSS feeds to find if certain
Duplicate of: There is a function to use pattern matching (using regular expressions) in
Please I want to validate the skype name using regular expressions in PHP. NOTE:
Is there a guide to using regular expressions in objective c? Specifically what to
What is the best method for using Regular Expressions within Objective-C? There seems to
How can I get only the first line of multiline text using regular expressions?
How to get last word inside slashes using Regular Expressions in a URL? Example
Using regular expressions (in any language) is there a way to match a pattern
I'm using regular expressions in PHP to parse the weather results that Google provides

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.