in reply to Quick question on matching
Yes, you need to use parentheses, like this:
The parentheses group parts of the regular expression, in addition to "capturing" parts of it that you can use in subsequent code. Both functions are important here: I'm guessing that you actually wanted to match just the letters, not the surrounding whitespace. In other words, I'm guessing that you didn't want what your original expression was doing: matching one ofif (/\b(API|APIN|UWI)\s*\./) { somesub($1); }
More information at perlre.
HTH
|
|---|