in reply to Vertical Regex

You are probably better off writing a parser that can parse the entire file, turns in into a structure (a list of hashes for instance), and then processes the structures.

From the example I'd say writing a parser is fairly trivial, but without a spec of how such an FRG file can be formatted it's hard to say. But that isn't any different from trying to solve the problem with a handful of regexes.

Replies are listed 'Best First'.
Re^2: Vertical Regex
by joomanji (Acolyte) on Jun 04, 2009 at 16:23 UTC
    I agree with you that writing a parser to parse the entire file is more feasible and can be use to extract other information. For this script, i would like to learn how to confine searches from the input text. From here, I should learn and apply it to make it a better parser. I'm very interested to know how to parse a text file to a list of hash, as when the file getting very big, it would be ideal to speed up the search process?