Is there a way to write a regular expression such that it will produce a match for each of a series of repeating tokens.

I'm trying to parse a query string into a set of name,value matches. These are my test input cases:

a = b
&a=b&
a=b& c=d
a =b&c=d&
a=b&c= d&e=f

I'd like to produce matches of (a,b) or (a,b,c,d) or (a,b,c,d,e,f). It's obvious for a human to see what the desired matches are.

The following regexp will match against the first token of each example and give the correct matching substrings.

[& ]*([^= ]*)[ ]*=[ ]*([^&= ]*)[& ]*

But is there a way to make the pattern iterate over the entire input and return multiple matches. I could write controlling logic to walk through the input string but it would be easier if I could make the regexp engine do it.

Thanks.