Philip Prindeville wrote:
>> header L_INCOMPETENT1            ALL =~ /\\r\\n/
>> 
>> header L_INCOMPETENT2            ALL =~ /\\r\\n\s?$/
>> 
>> header L_INCOMPETENT3            ALL =~ /\\r\\n\s?\n/
> 
> Ok, I tried #3 and it worked, as you said...  But leaving the \s?
> didn't. 
> 
> I'm confused.  What exactly is in the pattern buffer when the match
> for ALL is run?  And why does taking the \s? fail?  What is it
> matching against? 

ALL is a multiline string containing all the headers.
By default $ only matches at the end of a string and NOT at internal newlines.
You can get the behavior you want by using the /m modifier:

header L_INCOMPETENT4            ALL =~ /\\r\\n\s?$/m

or by specifying [\s\n] as a class:
header L_INCOMPETENT5            ALL =~ /\\r\\n[\s\n]?/

$ perl -e 'print "a\nb" =~ /a$/'

$ perl -e 'print "a\nb" =~ /a$/m'
1

-- 
Matthew.van.Eerde (at) hbinc.com               805.964.4554 x902
Hispanic Business Inc./HireDiversity.com       Software Engineer

Reply via email to