Loading ...
Sorry, an error occurred while loading the content.

HTML tags

Expand Messages
  • pdistant@linneydesign.com
    Does anyone know how to create a RE to filter out all html tags within a file or string? i.e. matching all tags (bold, font, table tags etc.). I would
    Message 1 of 3 , Apr 21, 2000
    • 0 Attachment
      Does anyone know how to create a RE to filter out all html tags
      within a file or string? i.e. matching all tags (bold, font, table
      tags etc.).

      I would appreciate any help on this!

      Cheers,

      Distie!
    • Dan Boger
      On Fri, 21 Apr 2000 15:49:17 -0000 pdistant@linneydesign.com wrote ... well, this is not a perfect solution, but this will work for most basic html... $file =~
      Message 2 of 3 , Apr 21, 2000
      • 0 Attachment
        On Fri, 21 Apr 2000 15:49:17 -0000 pdistant@... wrote
        concerning '[PBML] HTML tags':
        > Does anyone know how to create a RE to filter out all html tags
        > within a file or string? i.e. matching all tags (bold, font, table
        > tags etc.).

        well, this is not a perfect solution, but this will work for most
        basic html...

        $file =~ s/<.*?>//g;

        This will fail for things like bare ">" (which are not valid html
        anyway) and for a lot of javascript and html comments... but for the
        average html page, it should work fine.

        Dan

        Dan Boger - Georgetown Institute for Cognitive and Computational Sciences
        dan@... ICQ: 1130750
        Georgetown University Medical Center Washington, DC
      • Ingenue
        s/ //g; or in vi... :1,$:s/ //g ... From: To: Sent: Friday, April 21, 2000 8:49 AM Subject:
        Message 3 of 3 , Apr 21, 2000
        • 0 Attachment
          s/<.*>//g;

          or in vi... :1,$:s/<.*>//g



          ----- Original Message -----
          From: <pdistant@...>
          To: <perl-beginner@egroups.com>
          Sent: Friday, April 21, 2000 8:49 AM
          Subject: [PBML] HTML tags


          > Does anyone know how to create a RE to filter out all html tags
          > within a file or string? i.e. matching all tags (bold, font, table
          > tags etc.).
          >
          > I would appreciate any help on this!
          >
          > Cheers,
          >
          > Distie!
          >
          >
          >
          > ------------------------------------------------------------------------
          > Enjoy the award-winning journalism of The New York Times with
          > convenient home delivery. And for a limited time, get 50% off for the
          > first 8 weeks by subscribing. Pay by credit card and receive an
          > additional 4 weeks at this low introductory rate.
          > http://click.egroups.com/1/3102/1/_/12898/_/956332161/
          > ------------------------------------------------------------------------
          >
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.