2.1.0 • Published 1 year ago

quasarjs v2.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
1 year ago

NPM

Search base_text for matching-all words of search_term, case-insensitive in any order, except treat "words in quotes" as if a single word like in Google search.

Copy as Function Directly into Code

var search_term_is_found = base_text.match(

new RegExp("(?=(.|[\r\n])*" + search_term

.match(/"([^"]+)"|[\w]+/gi)

.join(")((.|[\?=r\n])*")

.replace(/\"/g,'')+")(.|[\r\n])+", "ig")

)!=null

Built Using RegEx Negative Lookaheads (?=

bar(?=bar) finds the 1st bar ("bar" which has "bar" after it)

bar(?!bar) finds the 2nd bar ("bar" which does not have "bar" after it)

(?<=foo)bar finds the 1st bar ("bar" which has "foo" before it)

(?<!foo)bar finds the 2nd bar ("bar" which does not have "foo" before it)

2.1.0

1 year ago

2.0.0

1 year ago

1.0.1

8 years ago

1.0.0

8 years ago