const
Regex compilation
#1012
-
I think compiling a However, no Sorry if the question is dumb, I'm a noob. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It is somewhat addressed here: #913 For the specific case of a The issue I linked addresses the more general case of "compile time regex" and specifically, "a serialization format for a regex that enables cheap deserialization." Rust |
Beta Was this translation helpful? Give feedback.
It is somewhat addressed here: #913
For the specific case of a
const
method, theoretically, one could implement a regex engine using Rustconst
, but certainly not the one in this crate. To a first approximation, in order for this crate to have apub const fn new(pattern: &'static str) -> Regex
, you would need to have most of the Rust language usable inside aconst
context. That is nowhere near the case today.The issue I linked addresses the more general case of "compile time regex" and specifically, "a serialization format for a regex that enables cheap deserialization." Rust
const
is just one way of getting a compile time regex. There are other techniques, as that issue covers.