Skip to main content

Module regex

Module regex 

Source
Expand description

libxml2’s internal regex engine (§85 Phase 7).

libxml2 uses its own regex engine (xmlregexp.c) for XML Schema pattern facets, XSLT template match patterns, and other internal uses. Must match upstream behavior exactly.

Implements an NFA-based regex engine using Thompson’s construction:

  • Compilation: regex pattern → NFA
  • Execution: NFA simulation with state-set tracking
  • Incremental matching: push strings into an execution context
  • Determinism check

Structs§

RegExecCtxt
Incremental regex execution context.
XmlRegexp
Compiled regular expression.

Functions§

xmlRegExecPushString
Push a string into the incremental regex execution context.
xmlRegFreeExecCtxt
Free an incremental regex execution context.
xmlRegFreeRegexp
Free a compiled regex.
xmlRegNewExecCtxt
Create an incremental regex execution context.
xmlRegexpCompile
Compile a regex pattern.
xmlRegexpExec
Execute a compiled regex against a string.
xmlRegexpIsDeterministic
Check if a compiled regex is deterministic.
xmlRegexpPrint
Print a compiled regex for debugging.