This a modified copy of Henry Spencer's regex library, it was originally
snarfed from http://arglist.com/regex/. The following changes were made:

REGCOMP.C line 1438 changed to

 assert(value < 1L<<OPSHIFT);

REGEX.H before line 9 inserted

 #ifdef __TURBOC__
  typedef long off_t;
 #endif

REGEX2.H line 49-68 changed to

 #define OEND (1L<<OPSHIFT) /* endmarker -   */
 #define OCHAR (2L<<OPSHIFT) /* character unsigned char  */
 #define OBOL (3L<<OPSHIFT) /* left anchor -   */
 #define OEOL (4L<<OPSHIFT) /* right anchor -   */
 #define OANY (5L<<OPSHIFT) /* .  -   */
 #define OANYOF (6L<<OPSHIFT) /* [...] set number  */
 #define OBACK_ (7L<<OPSHIFT) /* begin \d paren number  */
 #define O_BACK (8L<<OPSHIFT) /* end \d paren number  */
 #define OPLUS_ (9L<<OPSHIFT) /* + prefix fwd to suffix  */
 #define O_PLUS (10L<<OPSHIFT) /* + suffix back to prefix  */
 #define OQUEST_ (11L<<OPSHIFT) /* ? prefix fwd to suffix  */
 #define O_QUEST (12L<<OPSHIFT) /* ? suffix back to prefix  */
 #define OLPAREN (13L<<OPSHIFT) /* (  fwd to )  */
 #define ORPAREN (14L<<OPSHIFT) /* )  back to (  */
 #define OCH_ (15L<<OPSHIFT) /* begin choice fwd to OOR2  */
 #define OOR1 (16L<<OPSHIFT) /* | pt. 1 back to OOR1 or OCH_ */
 #define OOR2 (17L<<OPSHIFT) /* | pt. 2 fwd to OOR2 or O_CH */
 #define O_CH (18L<<OPSHIFT) /* end choice back to OOR1  */
 #define OBOW (19L<<OPSHIFT) /* begin word -   */
 #define OEOW (20L<<OPSHIFT) /* end word -   */

CHANGES MADE BY Z88DK

To accept \t as tab and \\ as single \ character
https://github.com/z88dk/z88dk/commit/29777342c67b61d95e88696055a5845181f20ce6

Some documentation for using regex:

regcomp
http://www.mkssoftware.com/docs/man3/regcomp.3.asp

regexec
http://www.mkssoftware.com/docs/man3/regexec.3.asp

regerror
http://www.mkssoftware.com/docs/man3/regerror.3.asp

regfree
http://www.mkssoftware.com/docs/man3/regfree.3.asp
