I'm working on a function to parse a text field. Below are some scenarios:
In: "about"
Result: var keywords = "about"
In: "type:page " (notice the space)
Result: var types = ["page"];
In: "type:page about"
Result: var types = ["page"], keywords = "about";
In: "type:page,event The Event"
Result: var types = ["page", "event"], keywords = "The Event";
Can someone point me in the right direction as to how I'd parse this using RegEx?
The Event type:page,event? I think you need to write a full function instead of a single line of regexp