MESSAGE
DATE | 2003-07-17 |
FROM | From: "Steve Milo"
|
SUBJECT | Subject: [hangout] Perl pattern matching
|
You could do something like
if $pattern =~ (/(pattern to remove)\s(pattern to keep)/) { print $2, "\n";}
In other words you isolate the different patterns in parenthesis. You can use anything in those parenthises regexp or text. If the pattern matches you can then print the pattern you want as a scalar variable. Keep in mind you have to account for white spaces, etc if you are using pattern matching.
But to answer your question, you may not be matching the pattern exactly. The above might help you troubleshoot.
Steve
____________________________ NYLXS: New Yorker Free Software Users Scene Fair Use - because it's either fair use or useless.... NYLXS is a trademark of NYLXS, Inc
|
|