noprompt / frak

Transform collections of strings into regular expressions.
1.13k stars 39 forks source link

Don't group terminal character sets #3

Closed noprompt closed 11 years ago

noprompt commented 11 years ago

This:

(frak/pattern ["bits" "bite" "bit"])

produces bit(?:[se])? but should produce bit[se]?.

lijim commented 11 years ago

As an exercise, I partially rewrote frak in python, and came across a similar issue, so I resolved it via control flow (lines 69 - 79)

https://github.com/lijim/regex-generate/blob/master/regex_gen.py

noprompt commented 11 years ago

Excellent! I realized today I need to refactor some of the branch rendering code. Thanks for sharing this!