yangre [-V] -p REGEXP [-i] [-p REGEXP [-i]...] STRING
yangre [-V] -f FILE
yangre is a command-line tool to test and evaluate regular expressions for use in YANG schemas. Supported regular expressions are defined by the W3C's XML-Schema standard.
yangre can be used either with regular expressions and a target string on the command line or with input from a file. The latter is particularly useful to avoid dealing with proper shell escaping of regular expression patterns, which can be somewhat tricky.
- -h, --help
Outputs usage help and exits.
- -v, --version
Outputs the version number and exits.
- -V, --verbose
Increases the verbosity level. If not specified, only errors are printed, with each appearance it adds: warnings, verbose messages, debug messages (if compiled with debug information).
Command Line Input
- -p REGEXP, --pattern=REGEXP
One or more regular expression patterns to be tested against the input string. Supplied expressions are tested in the order they appear on the command line. Testing is aborted when an expression does not match (or does match, if the -i option is used.)
- -i, --invert-match
Reverse match condition for the previous pattern. If the pattern matches, an error is printed and evaluation is aborted.
Target text input to match the regular expression(s) against. The same text is used for all regular expressions. Note that only the first argument is used by yangre, if it contains spaces or other shell metacharacters they must be properly escaped. Additional arguments are silently ignored.
- -f FILE, --file=FILE
Read both patterns and target text from the specified input file.
FILE must consist of one or more YANG regular expressions, each on their own line, followed by a blank line and one line of target text. No preprocessing is done on file input, there are no comment lines and whitespace is not stripped. A single space character at the beginning of a pattern line inverts the match condition for the pattern on that line. Patterns must still be properly quoted as mandated by the YANG standard.
The target text matched for all patterns.
One or more patterns did not match the target text. An error message is printed to stderr describing which pattern was the first not to match.
One or more patterns could not be processed or some other error occurred that precluded processing.
https://github.com/CESNET/libyang (libyang homepage and Git repository)
Radek Krejci <firstname.lastname@example.org>, Michal Vasko <email@example.com>
This man page was written by David Lamparter <firstname.lastname@example.org>
Copyright © 2015-2018 CESNET, a.l.e.