- verbose mode is now supported with the
--verboseflag to produce regular expressions which are easier to read (#17)
- case-insensitive matching regexes are now supported with the
--ignore-casecommand-line flag or withFeature::CaseInsensitivityin the library (#23) - non-capturing groups are now the default; capturing groups can be enabled with the
--capture-groupscommand-line flag or withFeature::CapturingGroupin the library (#15) - a lower bound for the conversion of repeated substrings can now be set by specifying
--min-repetitionsand--min-substring-lengthor using the library methodsRegExpBuilder.with_minimum_repetitions()andRegExpBuilder.with_minimum_substring_length()(#10) - test cases can now be passed from a file within the library as well using
RegExpBuilder::from_file()(#13)
- the rules for the conversion of test cases to shorthand character classes have been updated to be compliant to the newest Unicode Standard 13.0 (#21)
- the dependency on the unmaintained linked-list crate has been removed (#24)
- test cases starting with a hyphen are now correctly parsed on the command-line (#12)
- the common substring detection algorithm now uses optionality expressions where possible instead of redundant union operations (#22)
- new unit tests, integration tests and property tests have been added
- conversion to character classes
\d,\D,\s,\S,\w,\Wis now supported - repetition detection now works with arbitrarily nested expressions. Input strings such as
aaabaaabwhich were previously converted to^(aaab){2}$are now converted to^(a{3}b){2}$. - optional syntax highlighting for the produced regular expressions can now be enabled using the
--colorizecommand-line flag or with the library methodRegExpBuilder.with_syntax_highlighting()
- new unit tests, integration tests and property tests have been added
- new property tests have been added that revealed new bugs
- entire rewrite of the repetition detection algorithm
- the former algorithm produced wrong regular expressions or even panicked for certain test cases
- property tests have been added using the proptest crate
- big thanks go to Christophe Biocca for pointing me to the concept of property tests in the first place and for writing an initial implementation of these tests
- some regular expression specific characters were not escaped correctly in the generated expression
- expressions consisting of a single alternation such as
^(abc|xyz)$were missing the outer parentheses. This caused an erroneous match of strings such asabc123or456xyzbecause of precedence rules. - the created DFA was wrong for repetition conversion in some corner cases. The input
a, aa, aaa, aaaa, aaabpreviously returned the expression^a{1,4}b?$which erroneously matchesaaaab. Now the correct expression^(a{3}b|a{1,4})$is returned.
- some minor documentation updates
- grex is now also available as a library
- escaping of non-ascii characters is now supported with the
-eflag - astral code points can be converted to surrogate with the
--with-surrogatesflag - repeated non-overlapping substrings can be converted to
{min,max}quantifier notation using the-rflag
- many many many bug fixes :-O
- character classes are now supported
- input strings can now be read from a text file
- unicode characters are not escaped anymore by default
- the performance of the DFA minimization algorithm has been improved for large DFAs
- regular expressions are now always surrounded by anchors
^and$
- fixed a bug that caused a panic when giving an empty string as input
This is the very first release of grex. It aims at simplifying the construction of regular expressions based on matching example input.
- literals
- detection of common prefixes and suffixes
- alternation using
|operator - optionality using
?quantifier - concatenation of all of the former