What's does m{} do ?

2005-12-27 Thread Mark R . London
What does m{} do, like in the following test? body DRUG_DOSAGEm{[\d\.]+ *\$? *(?:[\\/]|per) *d.?o.?s.?e}i

Re: What's does m{} do ?

2005-12-27 Thread Jason Frisvold
On 12/27/05, Mark R. London [EMAIL PROTECTED] wrote: What does m{} do, like in the following test? body DRUG_DOSAGEm{[\d\.]+ *\$? *(?:[\\/]|per) *d.?o.?s.?e}i Looks like a case insensitive match .. Let's see.. [\d\.]+ matches a digit or a period one or more times * (that's space

Re: What's does m{} do ?

2005-12-27 Thread Loren Wilton
[\d\.]+ matches a digit or a period one or more times * (that's space asterisk) matches 0 or more spaces \$? matches a dollar sign 0 or 1 time * (that's space asterisk) matches 0 or more spaces (?:[\\/]|per) I'm not 100% sure on.. It looks like it matches either :V or per ... * (that's space

Re: What's does m{} do ?

2005-12-27 Thread MATSUDA Yoh-ichi
Hello. From: Mark R.London [EMAIL PROTECTED] Subject: What's does m{} do ? Date: Tue, 27 Dec 2005 11:53:33 + (UTC) What does m{} do, like in the following test? m{[\d\.]+ *\$? *(?:[\\/]|per) *d.?o.?s.?e}i You can test perl REGEX on the command line: $ perl -ne 'print if m{[\d

Re: What's does m{} do ?

2005-12-27 Thread Jason Frisvold
On 12/27/05, Loren Wilton [EMAIL PROTECTED] wrote: Close, but not quite. (?:[\\/]|per) The (?:) is bracketing. A normal pair of parends would be 'capturing' and keep track of what was found within the grouping. The ?: modifier tells Perl to not bother capturing the contents, since it

Re: What's does m{} do ?

2005-12-27 Thread Mark London
Sorry, I wasn't clear about my question, which is why is m{} used in that test rather than simply //, or are they identical? (There are only a couple of tests which use m{} in Spamassassin).

Re: What's does m{} do ?

2005-12-27 Thread Matt Kettler
At 09:34 AM 12/27/2005, Mark London wrote: rather than simply //, or are they identical? (There are only a couple of tests which use m{} in Spamassassin). They are identical, but they do have one advantage.. you can use / inside the rule text without having it escape it. it makes things