What does m{} do, like in the following test?
body DRUG_DOSAGEm{[\d\.]+ *\$? *(?:[\\/]|per) *d.?o.?s.?e}i
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
[\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
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
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
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).
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