Next: , Previous: , Up: regexps   [Contents][Index]


3.3 Inspecting regular expressions

Function: const char * cre2_pattern (const cre2_regexp_t * rex)

Whether rex is a successfully built regular expression object or not: return a pointer to the pattern string. The returned pointer is valid only while rex is alive: if cre2_delete() is applied to rex the pointer becomes invalid.

Function: int cre2_program_size (const cre2_regexp_t * rex)

If rex is a successfully built regular expression object: return a non–negative integer representing the program size, a very approximate measure of a regexp’s “cost”; larger numbers are more expensive than smaller numbers. If an error occurred while building rex: return -1.


Next: , Previous: , Up: regexps   [Contents][Index]

This document describes version 0.4.0-devel.2 of CRE2.