View Single Post
Old 3 Sep 2019, 05:02 PM   #9
JamesHenderson
Cornerstone of the Community
 
Join Date: Jan 2003
Location: Oxfordshire, UK
Posts: 603
Thanks for your reply!

Quote:
Originally Posted by xyzzy View Post
Commas are only needed to separate multiple tests, i.e., a list of tests. It has nothing to do with multiple lines. You can put the list items on multiple lines, single lines, any combination.
You are quite right - I put each test on a seperate line to keep it tidy; I meant test, when I wrote line

Quote:
Originally Posted by xyzzy View Post
:matches "From" "*[.@]linkedin.com"

So is the intent here to look for anything or nothing followed by a dot or @ followed by linkedin.com? What's wrong with just "*@linkedin.com"? Personally I never used square brackets within a globing expression so that's what threw me off.
Yes, I am looking at either of the following:
name@domain.tld
name@subdomain.domain.tld
Quote:
Originally Posted by xyzzy View Post
For matches brackets are also for specifying a list of alternatives, i.e., ["a", "b", "c']. In regex brackets enclose a list of characters or character ranges. But as shown that is not a valid regex expression.
Oh. This worked in regexr.com and I am sure that's how Bron wrote it in a piece of sieve code he gave me some years ago that I no longer have.

Quote:
Originally Posted by xyzzy View Post
The equivalent regex to a matches "*@linkedin.com" would be would be ".*@linkedin.com" or if you're a purist maybe ".+@linkedin.com".
"." and "@' are my alternatives.
JamesHenderson is offline   Reply With Quote