Skip to content
Derek Callaway edited this page Nov 15, 2018 · 13 revisions

strglob wiki

  1. strglob is a C development library designed to enumerate characters/numbers/strings by expanding "globbing" pattern syntax.
  2. Its purpose is to provide a compact specification for test case input string generation.
  3. strglob supports a wide variety of syntax types for both character and string generation including:

Ranges

Digital Ranges

Letter Ranges

Reverse Ranges

Classes

Character Classes

String Classes

Sets

String Sets

Shell Features

Environment Expansion

File Includes

Notes

Numeric and character ranges are denoted by square brackets

  • [0-9] (numeric range)
  • [a-z] (character range)

Strings are signified with curly braces

  • {abc} (string literal)

Range limits are delimited by dashes which are also for signing negative integers

  • [-1--3] (range from negative to negative)
  • [-1-3] (range from negative to positive)
  • [1--3] (range from positive to negative)
  • [1-3] (range from positive to positive)

String sets are separated by commas

  • {foo,bar,baz} (set of string literals)

Both character and string class names are surrounded by colons

  • {:Wdays:} (string class)
  • [:alnum:] (character class)

Most character class identifiers are taken from the standard C library's ctype.h header file

  • [:punct:] (from ctype.h)
  • [:number:] (NOT from ctype.h)

Bash-style sequence expressions are specified with curly braces and take an optional numeric increment value

  • {0..4..1} (Bourne Again style brace expansion sequence expression, refer to bash(1))