in reply to Re: Parsing with RegEx into Array
in thread Parsing with RegEx into Array

that worked perfectly. but what If <item> is < item> (with a space in it. Is there a way to handle it?

Replies are listed 'Best First'.
Re^3: Parsing with RegEx into Array
by ikegami (Patriarch) on Jun 25, 2010 at 18:31 UTC

    Are you really asking how to optionally match a space with a regex?

Re^3: Parsing with RegEx into Array
by JediWizard (Deacon) on Jun 25, 2010 at 18:31 UTC

    $str =~ m{<\s*item\s*><i>(.*?)</i></\s*item\s*>}

    They say that time changes things, but you actually have to change them yourself.

    —Andy Warhol