I'm supposed to enforce a certain search-syntax in a text input, and after watching several RegEx videos and tutorials, I'm still having difficulties creating a regex for my purpose.
The expression structure should be something like that:
$earch://site.com?y=7, app=app1, wu>7, cnt<>8, url=http://kuku.com?adasd=343 , p=8
may start with a free text search that may contain any character other than the delimiter, which is ,
. (free text must be first, and the string may be ONLY free text search).
after free text comma-separated parts of field names which consist only [a-z][A-Z]
, followed by operator: (=|<|>|<>)
and followed by field search value that may be anything but ,
.
between the commas that separate the parts there may be spaces (\s*)
.
The free text part or at least one field=value must appear in order for the string to be valid.
Did anyone understand the question? :)