in reply to Quick question on matching
As you originally wrote the expression, it would match "API" following a word boundary, or "APIN" anywhere on a line (e.g. in CHAPIN), or "UWI\s*\." anywhere on a line.if ( /\b(API|APIN|UWI)\s*\./ ) { $myvar = $1 } # $1 is set to whatever was matched inside the parens # (if there were more than 1 set of parens, additional # paren'ed strings would be set to $2, $3...
Read the perlre documentation -- it's long, but very worthwhile.
|
|---|