Reputation: 281
I'm trying to make my code more readable but still try have as much sense as possible, I would like to test a string vs a few regex patterns.
( re-find #"(?i)(^select .* from .*)|(^delete from me)" c))
And I would like to split this into 2 separate patterns but maybe use one test? is there anything that would test a set of patterns vs 1 string?
Thanks!
Upvotes: 3
Views: 910
Reputation: 22258
(def patterns [#"(?i)^select .* from .*" #"(?i)^delete from me"])
(when (some #(re-find % "your test string") patterns)
...)
Upvotes: 4