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

YARQ: Yet Another Regex Question

Thread Next
Mathew Snyder
May 16, 2007 04:06
YARQ: Yet Another Regex Question
Message ID:
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
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?

Keep up with me and what I'm up to:

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About