Discussion:
expressions clarification
(too old to reply)
Dino Edwards
2016-03-02 14:06:55 UTC
Permalink
I'm trying to figure out what the difference between the following expressions are:

[qr'.\.(mdb)$'ix => 0]
[qr'.\.(uue)$'i => 0]
[qr'^\.(lha)$' => 0]

Mainly, trying to figure out when you put in "ix", "i" or nothing at all at the end of the expression.

Thanks
Pete Houston
2016-03-02 14:27:34 UTC
Permalink
Post by Dino Edwards
[qr'.\.(mdb)$'ix => 0]
[qr'.\.(uue)$'i => 0]
[qr'^\.(lha)$' => 0]
Mainly, trying to figure out when you put in "ix", "i" or nothing at all at the end of the expression.
'x' means ignore whitespace and comments
'i' means ignore case

perldoc perlre for the full details:
http://perldoc.perl.org/perlre.html#Modifiers

Pete
--
Openstrike - improving business through open source
http://www.openstrike.co.uk/ or call 01722 770036
Dino Edwards
2016-03-02 15:01:14 UTC
Permalink
Is there a scenario where whitespace, comments and case should not be ignored?
-----Original Message-----
From: amavis-users [mailto:amavis-users-
Houston
Sent: Wednesday, March 02, 2016 9:28 AM
Subject: Re: expressions clarification
Post by Dino Edwards
I'm trying to figure out what the difference between the following
[qr'.\.(mdb)$'ix => 0]
[qr'.\.(uue)$'i => 0]
[qr'^\.(lha)$' => 0]
Mainly, trying to figure out when you put in "ix", "i" or nothing at all at the
end of the expression.
'x' means ignore whitespace and comments 'i' means ignore case
http://perldoc.perl.org/perlre.html#Modifiers
Pete
--
Openstrike - improving business through open source
http://www.openstrike.co.uk/ or call 01722 770036
Tone Kravanja
2016-03-03 11:10:45 UTC
Permalink
i = ignore case
x = ignore (most) whitespace and permit comments in pattern

Best Regards,
Tone Kravanja


-----Original Message-----
From: Dino Edwards [mailto:***@mydirectmail.net]
Sent: Wednesday, March 2, 2016 3:07 PM
To: amavis-***@amavis.org
Subject: expressions clarification

I'm trying to figure out what the difference between the following expressions are:

[qr'.\.(mdb)$'ix => 0]
[qr'.\.(uue)$'i => 0]
[qr'^\.(lha)$' => 0]

Mainly, trying to figure out when you put in "ix", "i" or nothing at all at the end of the expression.

Thanks

Loading...