I’m trying to implement a simple and advanced search which lets me just type in a search for a default parameter but also has an advanced search box.
For example in the search box i search for “from” and “to” with a date range and it fills out the simple search with “from:xx/xx/xxxx to:xx/xx/xxxx” and will convert that for a get request.
I think what I need is a regex to split keyword:..., keyword:... and end of string up.
I other words, what is the regex to split “criteria1:blah blah criteria2:foo criteria3:bar”
or another solution would be a jquery plugin that does this.
The most straightforward way would be to use positive look-ahead:
You’ll need to change what characters allowed as criteria name and criteria value.