Grex Versions Save

A command-line tool and Rust library with Python bindings for generating regular expressions from user-provided test cases

v0.3.2

4 years ago

Test Coverage

  • new property tests have been added that revealed new bugs

Bug Fixes

  • entire rewrite of the repetition detection algorithm
  • the former algorithm produced wrong regular expressions or even panicked for certain test cases (#9)

v0.3.1

4 years ago

Test Coverage

  • 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

Bug Fixes

  • 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 as abc123 or 456xyz because of precedence rules.
  • the created DFA was wrong for repetition conversion in some corner cases. The input a, aa, aaa, aaaa, aaab previously returned the expression ^a{1,4}b?$ which erroneously matches aaaab. Now the correct expression ^(a{3}b|a{1,4})$ is returned.

Documentation

  • some minor documentation updates

v0.3.0

4 years ago

Features

  • grex is now also available as a library
  • escaping of non-ascii characters is now supported with the -e flag
  • astral code points can be converted to surrogate with the --with-surrogates flag
  • repeated non-overlapping substrings can be converted to {min,max} quantifier notation using the -r flag

Bug Fixes

  • many many many bug fixes :-O

v0.2.0

4 years ago

Features

  • character classes are now supported
  • input strings can now be read from a text file

Changes

  • 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 $

Bug Fixes

  • fixed a bug that caused a panic when giving an empty string as input

v0.1.0

4 years ago

This is the very first release of grex. It aims at simplifying the construction of regular expressions based on matching example input.

Features

  • literals
  • detection of common prefixes and suffixes
  • alternation using | operator
  • optionality using ? quantifier
  • concatenation of all of the former