From 14a0f867975f952553d9fdc1cf141cc22ebc8e6c Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Wed, 28 Nov 2018 21:09:13 -0500 Subject: [PATCH] regex/README: New file * regex/README: New file. --- regex/README | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 regex/README diff --git a/regex/README b/regex/README new file mode 100644 index 0000000..e639c49 --- /dev/null +++ b/regex/README @@ -0,0 +1,29 @@ +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.