Documentation ¶
Overview ¶
Package regen is a tool to parse and generate random strings from regular expressions.
This is a fork of github.com/nilium/regen.
It provides a function to generate string from regular expressions.
regen works by parsing a regular expression and walking its op tree. It is currently not guaranteed to produce entirely accurate results, but will at least try.
Limitations from upstream:
- Currently, word boundaries are not supported (until I decide how best to randomly insert a word boundary character).
- Using a word boundary op (\b or \B) will currently cause regen to panic.
- In addition, line endings are also poorly supported right now and EOT markers are treated as the end of string generation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenString ¶
GenString writes a response that should, ideally, be a match for rx to w, and proceeds to do the same for its sub-expressions where applicable. Returns io.EOF if it encounters OpEndText. This may not be entirely correct behavior for OpEndText handling. Otherwise, returns nil.