I need to filter a collection of strings based on a rather complex query - in it the "raw" form looks like this:
nano* AND (regulat* OR *toxic* OR ((risk OR hazard) AND (exposure OR release)) )
An example of one of the lines to match:
Workshop on the Second Regulatory Review on Nanomaterials, 30 January 2013, Brussels
So, I need to match AND OR characters and wildcards, so I guess I will need to use a regular expression in JavaScript.
I loop everything correctly, filter and work in general, but I am 100% sure that my regular expression is erroneous, and some results are mistakenly omitted - here it is:
/(nano[a-zA-Z])?(regulat[a-zA-Z]|[a-zA-Z]toxic[a-zA-Z]|((risk|hazard)*(exposure|release)))/i
Any help would be greatly appreciated - I really can't properly abstract my mind to understand this syntax!
UPDATE:
, , , , , ,
UPDATE:
, PHP - twitter API 1.0, . pastebin, ( , , ...):
: http://pastebin.com/MpWSGtHK
: http://pastebin.com/pP2AHEvk