problems with regular expressions

From: Dan Anderson (dan_at_mathjunkies.com)
Date: 11/29/03

  • Next message: James Edward Gray II: "Re: problems with regular expressions"
    To: beginners@perl.org
    Date: 29 Nov 2003 14:15:00 -0500
    
    

    I have a regular expression that looks like:

    $foo =~ s[class.*?=.*?'.*?'][]sgi;

    The problem I run into is that if the following is presented to match:

    <table class='foo'><tr class='baz'><td class='bar'>

    The regular expression will match:

    class='foo'><tr class='baz'><td class='bar'

    And I'll get:

    <table >

    Is there any way I can tell the .*? to match "" as well as "."?

    Thanks in advance,

    Dan


  • Next message: James Edward Gray II: "Re: problems with regular expressions"