Libecoli 0.11.1
Extensible COmmand LIne library
Loading...
Searching...
No Matches
Regex node

A node that matches input against a regular expression. More...

Functions

struct ec_nodeec_node_re (const char *id, const char *str)
int ec_node_re_set_regexp (struct ec_node *node, const char *re)

Detailed Description

A node that matches input against a regular expression.

Configuration Schema

schema re {
string pattern {
description "The pattern to match.";
}
}

Function Documentation

◆ ec_node_re()

struct ec_node * ec_node_re ( const char * id,
const char * str )

Create a regular expression node.

Parameters
idThe node identifier.
strThe regular expression pattern (POSIX extended regex).
Returns
The node, or NULL on error (errno is set).

◆ ec_node_re_set_regexp()

int ec_node_re_set_regexp ( struct ec_node * node,
const char * re )

Set the regular expression on a regex node.

Parameters
nodeThe regex node.
reThe regular expression pattern. It is duplicated internally.
Returns
0 on success, -1 on error (errno is set).