Next: , Up: GNU Regex Functions   [Contents][Index] GNU Pattern Buffers

To compile, match, or search for a given regular expression, you must supply a pattern buffer. A pattern buffer holds one compiled regular expression.6

You can have several different pattern buffers simultaneously, each holding a compiled pattern for a different regular expression.

regex.h defines the pattern buffer struct with the following public fields:

  unsigned char *buffer;
  unsigned long allocated;
  char *fastmap;
  char *translate;
  size_t re_nsub;
  unsigned no_sub : 1;
  unsigned not_bol : 1;
  unsigned not_eol : 1;



Regular expressions are also referred to as “patterns,” hence the name “pattern buffer.”