Have a string, for example: "foo=bar;foo1=somevalue1;foo2=value2;foo3=anothervalue3"

But only want to extract certain parts of the string, such as foo1 and it's value (until the semicolon), and foo3 and it's value (until the semicolon).

Any idea's how to do this? Have tried [foo1|foo3].*; but this might be nowhere near the solution...