in reply to url get variables regex

You cannot capture a variable amount of captures from a regexp. You can not capture more than there are paren pairs in the regexp (in 5.10, you can capture less).

What's wrong with one of the several URI or CGI modules out there that already do this task? Why try to do it all in a single regexp?

Replies are listed 'Best First'.
Re^2: url get variables regex
by clone4 (Sexton) on May 13, 2009 at 23:39 UTC
    I just realized that, so I changed the regex to:
    $arr[0..$count] = $url =~ /^http:\/\/.*?\?(?:([\w\d]*=)(?:.*[&]?))*/gi +;
    (of course still not working properly:))
    And to answer your question, I'm fairly firmly fixed just to mechanize module, and that only provides links method, which won't recognize the separate request variables... It is just matter of perfecting the line above:)