Regular Expressions 101

Community Patterns

Find and remove search facets so as to extract precise search keywords

0

Regular Expression
PCRE (PHP <7.3)

/
((AND|OR|NOT)( ))?([a-z_A-Z0-9]*):("\w+.*"|\w+(:?\w+))
/
gm

Description

Search facets are patterned like TAXONOMY:60047, GO:GO:34566, disease:"Alzheimer's Disease", modellingapproach:"Petri-net", so on. A query string is often made up search keywords and these facets. To extract precise search keywords, we get rid of those facets and the rest of the query string is search keywords.

Submitted by anonymous - 5 years ago