RegEx help

I need a bit of help with the regex for a pattern. The url has parameters like this;

x=foo bar&y=more foo bar

but sometimes the parameters look like:

x=foo bar(foo&bar)&y=more foo bar

The ampersand in the first parameter is confusing the parser and thinks that's the end of the token. Can someone suggest a way to parse this?

TIA.

Jim

Odd, as the ampersand in a

Odd, as the ampersand in a parameter value against HTTP specs. It should encode to '%26'.

If you know the parameter keys, you could just make an extractor for each. I might extract the whole string and parse it.