Help - Search - Members - Calendar
Full Version: What is a Regex Search?
Movable Type Community Forum > Additional Resources > Tips and Tricks
elisebauer
In the default search results display page there is a check box for "Regex Search". What does that mean? When I've checked it, it appears to do a search of the term in almost all of my weblogs (not all of them, one of them is consistently excluded). I've sinced changed the term "Regex Search" on the search page to read "search all elise.com sites" since that is what it appears to do, but I really don't know what it actually means. Also, if it is supposed to search all of the weblogs, why would it exclude any?

The site in question is: elise.com Simply Recipes.
LisaJill
regex = regular expression, tmk.
elisebauer
I thought so too, regex= regular expression. But if I do a search for apple on my little search window without checking the box, I only get results for the recipe site. If I check the regex box, I get results not only for the recipe site but also where the word apple appears in two of my other blogs. What's up with that?
girlie
The search form on the main page of your site has an IncludeBlogs parameter that restricts it to just that blog.

When you perform a search, the results page you see is using the default search template. The form in the default search template doesn't have the same IncludeBlogs parameter limiting the search, so whether you check the Regex box or not, the results are returned from all blogs.

You can confirm this by first searching for "apple" from the main page; then search for "apple" again on the results page without checking the Regex box.

To correct this behavior, you can either set up an Alternate Template as described in the manual on Public Search, and use the IncludeBlogs to restrict it to just that blog when subsequent searches are performed from the results page; or restrict your default search template to just that blog - which you probably don't want to do, because then your other blogs will use that same template.
elisebauer
Thank you Girlie, that worked! I have since removed the check boxes for Match case and Regex search for the search form on the recipe site. I think they are too confusing for my recipe audience, and unnecessary in this case.
elisebauer
As a relative newbie and non-techie, I found the term "regex search" to be somewhat confusing. What does it mean to search with regular expressions? I now have a good explanation, which I have posted here in What is a Regex Search? for the benefit of other newbies. Included are directions to remove the Regex Search check box from the search results page.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.