Filter - names in two formats

Tips on writing regular expressions for searching the post list

Moderators: Quade, dexter

Filter - names in two formats

Postby bonalymac » Thu Oct 21, 2021 12:22 pm

Another newbie problem please.

I'm trying to create a filter with authors names. As far as I can see from reading the help files, the best way is to do something like

John Smith | Jane Jones | Alex Johnson etc

But many posts use formats like

Smith, John | Jones, Jane | Johnson, Alex etc

Obviously I could simply double the size of the filter by looking for each version, or create a single filter for each version, but I wondered if there was a simple way to combine the search?

Thanks
bonalymac
Seasoned User
Seasoned User
 
Posts: 103
Joined: Wed Dec 28, 2005 9:12 pm

Registered Newsbin User since: 12/23/05

Re: Filter - names in two formats

Postby Quade » Thu Oct 21, 2021 2:23 pm

I pretty much answered this in the prior post you made.

"John.*Smith" for example. ".*" means "accept anything between the two words so",

"John Smith" and "John, Smith" would both match.

"Smith John" won't match.
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: Filter - names in two formats

Postby bonalymac » Thu Oct 21, 2021 3:07 pm

Many thanks, I did not know that the two answers would be linked.
bonalymac
Seasoned User
Seasoned User
 
Posts: 103
Joined: Wed Dec 28, 2005 9:12 pm

Registered Newsbin User since: 12/23/05

Re: Filter - names in two formats

Postby Quade » Thu Oct 21, 2021 10:16 pm

It's just the answers that are linked. What I suggested in the other post answers this post too.
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


Return to Regular Expressions

Who is online

Users browsing this forum: No registered users and 2 guests