I have an issue while parsing my Solr Queries that I pass on the querystring:
The values I end up having to work with look like this:
ed_deliveryMethod:Face to Face,ed_location:Alexandria,VA,ed_delivery:Onsite
I need a regex that would parse a key value pair:
So I need a regex to parse
FacetName:FacetValue
I was doing a split by commas but the comma on the location is throwing things off.
The last comma is optional since there might be just one filter.
I did try a lot of things before asking this question but no success. I'm not good at regex as you can see.
((?<Facet>.+):(?<FacetValue>.+),)+
Try the following:
(?<Facet>\w+):(?<FacetValue>.+?)(?=,\w+:|$)
Maybe you need to adjust \w to contain all allowed charactes of your keys.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With