[Omaha.pm] Parsing a Text File

Andrew Embury drazak at ingenii.com
Fri May 29 13:40:57 PDT 2009


I have an array with multiple text patterns as its members.  I also have a
large text file with lines that may or may not have as part of the line the
same patterns that are stored as values in the array

I'm having problems figuring out an elegant way to iterate the file and do a
regex match based on the values that are stored in the array.

Can anyone point me in the right direction on a good way to regex match a
file and only output the lines that contain one of the patterns in the
array?  The text file is large, so iterating the file mutiple times is not a
good solution for me.

Thanks,

Drew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/omaha-pm/attachments/20090529/0bfcd671/attachment.html>


More information about the Omaha-pm mailing list