night/regex
Mike Gerwitz 14a0f86797
regex/README: New file
* regex/README: New file.
2018-11-28 21:10:46 -05:00
..
fall Initial commmit with fall script 2018-11-24 00:02:15 -05:00
.gitignore Initial commmit with fall script 2018-11-24 00:02:15 -05:00
README regex/README: New file 2018-11-28 21:10:46 -05:00
animate animate: Add -c option for variable-width frames 2018-11-24 23:57:48 -05:00
base10-inc.sed base10-mul.sed: Multiply two base-10 numbers using regexes 2018-11-24 00:02:26 -05:00
base10-mul.sed animate: Add -c option for variable-width frames 2018-11-24 23:57:48 -05:00
bitwise.sed regex: Add equality scripts 2018-11-25 00:25:17 -05:00
cmp.sed env-{fixed,dyn}.sed: Accessing and manipulating envs 2018-11-28 20:57:58 -05:00
env-dyn.sed env-{fixed,dyn}.sed: Accessing and manipulating envs 2018-11-28 20:57:58 -05:00
env-fixed.sed env-{fixed,dyn}.sed: Accessing and manipulating envs 2018-11-28 20:57:58 -05:00
fall.sed Initial commmit with fall script 2018-11-24 00:02:15 -05:00

README

Regular Expression Hacks
========================
These scripts explore regular expressions in the formal sense---those that
represent precisely the types of languages that can be decided by a finite
state machine (Type-3 grammars in the Chomsky hierarchy).  This differs from
the types of regular expressions typically found in text editors and
programming languages, which are far more expressive.[0]

I expect eventually to go into what makes this so interesting, but for the
time being, know that these examples _can_ be solved more simply using
features of modern regex engines.  Sed, for example, does support
backreferences, which would have made certain examples here trivial to
implement.  But then they wouldn't have very much hack value, would they?

As such, these scripts are intentionally esoteric.  They are not things you
should probably use in a production system.

To run the, use the `animate' script.  If the sed script being run does not
produce fixed-width frames, use the `-c' option.  Example inputs and
commands can be found in many of the scripts.


[0]: https://en.wikipedia.org/wiki/Regular_expression


Copyright (C) 2018 Mike Gerwitz

This file is released under the Creative Commons Attribution-ShareAlike 4.0
International License.  See COPYING.CCBYSA for more information.