javascript - MongoDB regex does not match string between 2 pipes -
so want regex match type of elements, regex created in javascript.
i assume in mongo need \\ escape instead of one
element: toto|titi|tata|tete
if value
teteortitiortataortetereturnfalseif value
toorzeorwereturntruetoto|titivalue not matter because have regex removing specials characters value (it becometototiti)
atm used "(^|\|)" + value + "(\||$)" opposite - when value tete or titi or tata or tete return true
- when value
toorzeorwereturnfalse
i tried
"(^|\|)(?!" + value + ")(\||$)"didn't work"(^|\|)(?!" + value + ").*(\||$)"didn't work
i have no more idea, have 1 ?
Comments
Post a Comment