in reply to Conditional regex

Seems to me you are using the wrong approach. Wouldn't it make more sense to use something like HTML::Parser and just let it do the nasty work for you rather than struggling with complicated regular expressions?

Replies are listed 'Best First'.
Re^2: Conditional regex
by sherab (Scribe) on May 08, 2009 at 20:24 UTC
    It would be but sadly security is very tight here (federal agency) and I don't believe that HTML::Parser is a core mod
      Did you even try to get HTML::Parser installed? There are a lot of useful modules not in core, without which Perl misses very basic usefulness, such as DBI (to name but one). Did some federal security agency check all the core modules and gave them a "thumbs up"? I really doubt someone went to that effort.

      CountZero

      A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

      A reply falls below the community's threshold of quality. You may see it by logging in.
      Neither is any code we give you.