develooper Front page | perl.beginners | Postings from May 2007

YARQ: Yet Another Regex Question

Thread Next
From:
Mathew Snyder
Date:
May 16, 2007 04:06
Subject:
YARQ: Yet Another Regex Question
Message ID:
464AE51D.5080304@yahoo.com
I have a trouble ticket application that uses a regex to find a piece of
information in an incoming email and auto populate a field if it is found.  The
line it will be looking for is
CUSTOMER ENVIRONMENT customer_name
where customer_name will never have a space making it one word.  If I just want
to pull from the line the customer_name would my regex look like
$MatchString = "CUSTOMER ENVIRONMENT\s+(\w)"

For what it's worth the line that will handle this is
$found = ($Transaction->Attachments->First->Content =~ /$MatchString/m);
I'm guessing that when used in an assignment like this, $1 will be used as the
value.  The contents of (\w) in this case.  Is that correct?

Mathew
-- 
Keep up with me and what I'm up to: http://theillien.blogspot.com

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About