Searching for word containing periods (E.g., U.F.O.)

Tips on writing regular expressions for searching the post list

Moderators: Quade, dexter

Searching for word containing periods (E.g., U.F.O.)

Postby Spartacus12 » Wed Dec 12, 2012 3:48 am

I looked at the post titles in this regular expressions topic and did not see an answer so I will ask:
Suppose a feller wanted to search for a filename including the characters U.F.O. including the periods.
I tried U[.]F[.]O[.] and also U\.F\.O\. and found nothing. What is the proper syntax?
Spartacus12
Occasional Contributor
Occasional Contributor
 
Posts: 21
Joined: Thu Dec 06, 2012 8:04 pm

Registered Newsbin User since: 11/24/12

Re: Searching for word containing periods (E.g., U.F.O.)

Postby Quade » Wed Dec 12, 2012 10:19 am

How are you searching? Local or internet? The answer changes depending on how.
User avatar
Quade
Eternal n00b
Eternal n00b
 
Posts: 44981
Joined: Sat May 19, 2001 12:41 am
Location: Virginia, US

Registered Newsbin User since: 10/24/97

Re: Searching for word containing periods (E.g., U.F.O.)

Postby dexter » Wed Dec 12, 2012 12:36 pm

If the Search tab is in "Local" mode, the RE should work

If the Search tab is in "Internet" mode, that uses boolean searches. The problem with your search string is that the "." is removed to create keywords in the indexer. So you'd have to do a direct string match (which takes longer) to find what you are looking for. To do this, enter the string in quotes as "u.f.o." with nothing else in the line. The parser is fairly simple and does not support mixing phrase searches and boolean searches. I just tried it myself and got 392 matches but it took about 30 seconds to process.
User avatar
dexter
Site Admin
Site Admin
 
Posts: 9514
Joined: Fri May 18, 2001 3:50 pm
Location: Northern Virginia, US

Registered Newsbin User since: 10/24/97

Re: Searching for word containing periods (E.g., U.F.O.)

Postby Spartacus12 » Wed Dec 12, 2012 9:09 pm

dexter wrote:If the Search tab is in "Local" mode, the RE should work

If the Search tab is in "Internet" mode, that uses boolean searches. The problem with your search string is that the "." is removed to create keywords in the indexer. So you'd have to do a direct string match (which takes longer) to find what you are looking for. To do this, enter the string in quotes as "u.f.o." with nothing else in the line. The parser is fairly simple and does not support mixing phrase searches and boolean searches. I just tried it myself and got 392 matches but it took about 30 seconds to process.


This was for an Internet search. Thank you dexter, this solution worked!
Spartacus12
Occasional Contributor
Occasional Contributor
 
Posts: 21
Joined: Thu Dec 06, 2012 8:04 pm

Registered Newsbin User since: 11/24/12


Return to Regular Expressions

Who is online

Users browsing this forum: No registered users and 2 guests