in reply to String Matching
Here it is with nicer formatting and a basic explanation:
m/ <=\s* (\S+) # Capture the email address following <= [^[]+\[ # Skip to the first subsequent square bracket. ([^\]]+) # Capture until a closing bracket. /x
You can tinker with it yourself here.
The email address will be in $1 and the IP will be in $2, following a successful match.
Update: Silly me for trusting the OP's spec. Kenosis mentioned to me that the exim record could, in addition to <= also contain any of ==, **, =>, *>, ->, and possibly some others. So the <= anchor is probably not ideal, but could be improved upon with (?:<=|==|\*\*|=>|\*>|=>) (plus whatever others are legal).
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: String Matching
by stevbutt (Novice) on Aug 14, 2012 at 08:12 UTC | |
by davido (Cardinal) on Aug 14, 2012 at 08:18 UTC | |
by stevbutt (Novice) on Aug 14, 2012 at 16:21 UTC | |
by AnomalousMonk (Archbishop) on Aug 14, 2012 at 16:41 UTC | |
by davido (Cardinal) on Aug 14, 2012 at 16:41 UTC | |
by stevbutt (Novice) on Aug 14, 2012 at 21:28 UTC | |
|