Skip to content

How to efficiently find the first matching regex from a (long) list of regexes? #1138

Answered by BurntSushi
psychon asked this question in Q&A
Discussion options

You must be logged in to vote

Does RegexSet work for you? Note its limitations however.

One thing that would make this question easier to answer is if you provided a code example implementing what you describe in prose. Something simple that captures the essence of what you're trying to do. But is ultimately something with some inputs and can be run by others. Then I could see if it makes sense to transform it to RegexSet or possibly something else entirely.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@psychon
Comment options

@BurntSushi
Comment options

Answer selected by psychon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants