▲ 43 ▼ Announcing list2regexp - Generate regular expressions to match lists of strings (codeberg.org) submitted 2 months ago by trevor@lemmy.ml to c/opensource@lemmy.ml 14 comments fedilink hide all child comments
[–] arran4@aussie.zone 1 point 2 months ago (2 children) Does it do exclusions? Can it merge regexp? permalink fedilink source hideshow 2 child comments replies: [–] trevor@lemmy.ml [S] 1 point 2 months ago* (1 child) Those would be interesting features, but it currently only operates on plain text lists, or lists with wildcards (*) which are converted into regexp (.*), or lists with CIDR suffixes (127.0.0.0/24). You can disable escaping, but list2regexp doesn't understand the individual segments of regular expressions, so the result will probably be wrong. With that said, the library being used to handle escaping and testing the generated patterns (regexp2) does expose the syntax tree so the information is available to do interesting things with, such as what you suggest. permalink fedilink source parent hideshow 1 child comment replies: [–] arran4@aussie.zone 1 point 2 months ago Merging probably has more value as people would understand the edge cases, with generated regexp it would be harder for someone to confidently understand the edges without having a deeper understanding of the algorithm and data set. permalink fedilink source parent
[–] trevor@lemmy.ml [S] 1 point 2 months ago* (1 child) Those would be interesting features, but it currently only operates on plain text lists, or lists with wildcards (*) which are converted into regexp (.*), or lists with CIDR suffixes (127.0.0.0/24). You can disable escaping, but list2regexp doesn't understand the individual segments of regular expressions, so the result will probably be wrong. With that said, the library being used to handle escaping and testing the generated patterns (regexp2) does expose the syntax tree so the information is available to do interesting things with, such as what you suggest. permalink fedilink source parent hideshow 1 child comment replies: [–] arran4@aussie.zone 1 point 2 months ago Merging probably has more value as people would understand the edge cases, with generated regexp it would be harder for someone to confidently understand the edges without having a deeper understanding of the algorithm and data set. permalink fedilink source parent
[–] arran4@aussie.zone 1 point 2 months ago Merging probably has more value as people would understand the edge cases, with generated regexp it would be harder for someone to confidently understand the edges without having a deeper understanding of the algorithm and data set. permalink fedilink source parent