Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使我的代码更具可读性,但仍然尝试尽可能多地有意义,我想测试一个字符串与一些正则表达式模式。
( re-find #"(?i)(^select .* from .*)|(^delete from me)" c))
我想把它分成两种不同的模式,但也许使用一个测试?有什么东西可以测试一组模式与 1 个字符串吗?
谢谢!
(def patterns [#"(?i)^select .* from .*" #"(?i)^delete from me"]) (when (some #(re-find % "your test string") patterns) ...)
clojure.core/一些