in reply to Something's awry in my regex...

I am SURE there is a better way, but this seems to work (has not been tested with all possible strings) :
while ($text =~ s/>\s+([\w\-]*?)\=([\w\-\"]*)\,?/ $1\=$2>/ixs) {}

can't sleep clowns will eat me
-- MZSanford

Replies are listed 'Best First'.
Re: Re: Something's awry in my regex...
by petesmiley (Friar) on Aug 23, 2001 at 00:08 UTC
    a tiny bit cleaner...although i could swear there was a way to do it without the while...
    one of merlyn's doins i could swear :) i could be smokin crack though

    while ($test =~ s/>\s*([\w-]*?="[\w-]*?"),?/ $1>/s) {}