N
N
noxxcuzz2021-01-22 18:48:21
Python
noxxcuzz, 2021-01-22 18:48:21

How to escape characters in a string passed to MongoDB as a regular expression?

It is necessary to search in MongoDB by regex, which includes the input string. The problem is that some strings include characters that MongoDB interprets as part of the regular expression. How to screen them correctly so that everything works?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question