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
tete
ortiti
ortata
ortete
returnfalse
if value
to
orze
orwe
returntrue
toto|titi
value 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
to
orze
orwe
returnfalse
i tried
"(^|\|)(?!" + value + ")(\||$)"
didn't work"(^|\|)(?!" + value + ").*(\||$)"
didn't work
i have no more idea, have 1 ?
Comments
Post a Comment