Matt Kettler wrote: > [EMAIL PROTECTED] wrote: > > 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 > > > > Matthew.. If the /m is needed, how come the exact same rule, #3 > above, works flawlessly without it?
Because rule #3 doesn't use $. The /m simply says to allow $ to match an EOL in the middle of the string intead of being constrained to the end as usual. \n is a literal and will always match anywhere, but it is a more strict match than $. -- Bowie