Questions tagged «rx»

1
如何使用rx创建动态正则表达式?
我想用来rx创建带有运行时值的正则表达式。 目前,我正在这样做: (setq strings '("foo" "bar" "baz")) (eval `(rx symbol-start (or ,@strings) symbol-end)) 但是,我宁愿避免使用eval。我已经找到rx-to-string,但尚不清楚我应该写什么形式: ;; error: Unknown rx form `symbol-start (rx-to-string '(symbol-start (or ,@strings) symbol-end)) 如何rx在运行时构建表达式?
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.