Time complexity of compiling a regex #1158
-
The documentation says that regex matching is performed in O(m*n), is there also some information about the complexity of compiling a regex (or is that even included in the above statement)? My use case would be to allow users to input arbitrary regexes which would then be compiled and used as a filter. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Can you say why this section in the docs didn't help you? It doesn't just narrowly address your time complexity question, but it also addresses your broader use case in a lot of detail. If you're accepting untrusted patterns from end users, I would recommend reading the entire section carefully. |
Beta Was this translation helpful? Give feedback.
Can you say why this section in the docs didn't help you? It doesn't just narrowly address your time complexity question, but it also addresses your broader use case in a lot of detail. If you're accepting untrusted patterns from end users, I would recommend reading the entire section carefully.