Simply Hao on Mon, 26 Jun 2000 14:27:39 -0400 (EDT)


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: regex question


Nic,

>> my @tokens = split /([<>])/, $badhtml;
>
> Can you explain the magic?

Funny, it doesn't look magical to me.  Maybe I've been hanging
around you guys too long.  "You can't fool me.  There ain't no
sanity clause."

Which part do you need explaining?

Character class containing two characters < and >:

    [<>]

IOW, match < or >.  Use it as the delimiter to split the string
$badhtml with:

    my @tokens = split /[<>]/, $badhtml;

Oh, btw, include the matching delimiters too:

    my @tokens = split /([<>])/, $badhtml;

See you tonight.

-Hao
**Majordomo list services provided by PANIX <URL:http://www.panix.com>**
**To Unsubscribe, send "unsubscribe phl" to majordomo@lists.pm.org**