Skip to content

holtchesley/jumprope

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jumprope

jumprope is a simple command line app to enumerate the strings generated by a (rust flavored) regular expression.

Installation

cargo install

Usage

jumprope rust 'a|b|c'

will produce

a

b

c

jumprope rust -i [regex] will interpret regex as case-insensitive. the -x flag will allow whitespace and comments. Be wary of your shell interpreting a regular expression, enclosing them in single quotes is highly recommended.

Rough edges

This is a first pass at it, and there are a few rough edges:

  • In some cases it will produce redundant strings. case-insensitive regular expressions with non-letter characters in them, concatenations of alternations that share common subexpressions (for example: "(a|b){2}(b|c){2}" will produce a few duplicates).
  • I'm not sure how to usefully produce multi-line strings yet, so they aren't supported very well.
  • Word boundaries and start/end of line epsilons can be used to create an infinite sequence of empty results. It will look like the program is just hanging while it sifts through these.
  • Other, as of yet undiscovered "fun"

Future work

The current version uses an approximation of A* (It's not exactly A*, there are some phantom nodes that are generated and skipped over to guarantee progress in the face of infinity). I may attempt to implement Hopcroft's algorithm or the like, and do a more efficient, and less duplicate-filled successor to this. I may also write parsers for other flavors of regular expressions (javascript, python, java, etc.). Other possibilities include a generator for ebnf defined grammars, substitution lists for capture groups, or other things. I did this for fun, but if it is genuinely useful to someone, or /close/ to useful, I'd be happy to hear about it.

About

A command line tool to enumerate regular expressions

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages