I need a .NET (C#) regular expression for parsing a string of search terms. The terms are key:value pairs and are delimited by spaces. The thing that’s throwing me for a loop is the fact that the key:value pairs may have spaces in the value.
Here’s an example string:
f:john l:smith c:san francisco st:ca
I expect to get back the following terms:
f:john
l:smith
c:san francisco
st:ca
Any help? Thanks.
I think that this one will work. It uses a lookahead to make sure that the last word doesn’t have a
:terminating it.