Automatically Generate Regular Expressions from User Input with grex

grex is a library as well as a command-line utility that is meant to simplify the often complicated and tedious task of creating regular expressions. It does so by automatically generating a single regular expression from user-provided test cases. The resulting expression is guaranteed to match the test cases which it was generated from. As …


This content originally appeared on Bram.us and was authored by Bramus!

grex is a library as well as a command-line utility that is meant to simplify the often complicated and tedious task of creating regular expressions. It does so by automatically generating a single regular expression from user-provided test cases. The resulting expression is guaranteed to match the test cases which it was generated from.

As Stefan shows: simply type in some terms into grex that you want to match and the RegExp comes out … ?

Also available as a Rust library.

use grex::RegExpBuilder;

let regexp = RegExpBuilder::from(&["a", "aa", "aaa"]).build();
assert_eq!(regexp, "^a(?:aa?)?$");

grex — a command-line tool and library for generating regular expressions from user-provided test cases →


This content originally appeared on Bram.us and was authored by Bramus!


Print Share Comment Cite Upload Translate Updates
APA

Bramus! | Sciencx (2021-03-26T20:48:14+00:00) Automatically Generate Regular Expressions from User Input with grex. Retrieved from https://www.scien.cx/2021/03/26/automatically-generate-regular-expressions-from-user-input-with-grex/

MLA
" » Automatically Generate Regular Expressions from User Input with grex." Bramus! | Sciencx - Friday March 26, 2021, https://www.scien.cx/2021/03/26/automatically-generate-regular-expressions-from-user-input-with-grex/
HARVARD
Bramus! | Sciencx Friday March 26, 2021 » Automatically Generate Regular Expressions from User Input with grex., viewed ,<https://www.scien.cx/2021/03/26/automatically-generate-regular-expressions-from-user-input-with-grex/>
VANCOUVER
Bramus! | Sciencx - » Automatically Generate Regular Expressions from User Input with grex. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/03/26/automatically-generate-regular-expressions-from-user-input-with-grex/
CHICAGO
" » Automatically Generate Regular Expressions from User Input with grex." Bramus! | Sciencx - Accessed . https://www.scien.cx/2021/03/26/automatically-generate-regular-expressions-from-user-input-with-grex/
IEEE
" » Automatically Generate Regular Expressions from User Input with grex." Bramus! | Sciencx [Online]. Available: https://www.scien.cx/2021/03/26/automatically-generate-regular-expressions-from-user-input-with-grex/. [Accessed: ]
rf:citation
» Automatically Generate Regular Expressions from User Input with grex | Bramus! | Sciencx | https://www.scien.cx/2021/03/26/automatically-generate-regular-expressions-from-user-input-with-grex/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.