in reply to RE: Re: Regex grabs too much
in thread Regex grabs too much

That worked perfectly! Can you explain what
[^<>]
actually is doing? That seems to be the only difference between your code and mine, and it confuses me considerably.

Replies are listed 'Best First'.
RE: RE: RE: Re: Regex grabs too much
by Anonymous Monk on Jun 05, 2000 at 21:45 UTC
    It means "not one of those two characters"

    viva el perl libre

RE: RE: RE: Re: Regex grabs too much
by mikfire (Deacon) on Jun 05, 2000 at 21:41 UTC
    I am not an lhoward and I do not play one on TV, but I can explain that bit of regex.

    lhoward has defined a set, as indicated by the [ ]. When perl's regex engine sees this, anything within the brackets will be considered a match. However, lhoward was tricky and made the first character a ^. When the first character of set is a ^, it negates the set ( mathematicians call it the complement, but I can't spell 'complement' ) and tells the regex to match everything but what is in the set.

    [^<>]
    is saying to match anything that isn't a < or a >

    HTH,
    mikfire