Special Rule Elements

NLP++ has a set of predefined rule elements that make writing rules easier.  These special rule elements match various types of tokens such as alpha characters, punctuation, wildcards, etc.  For examples of these special rule elements, refer to the individual pages included in the Special Rule Elements section.

Special rule elements are given in the following table.




Match anything.  _xWILD is an unrestricted wildcard. Key-value pairs may add restrictions on number of nodes matched and on what is matched. (Note: with a match or fail list, _xWILD becomes an "OR" matching function.)


Match any single node. (WARNING:  A rule written with _xANY [max=0] will not work.  _xANY is not implemented as a wildcard.  Instead, the near equivalent _xANY _xWILD should be used.)


Match nothing.  _xNIL designates a suggested element when the rule performs a special action, such as removing the matched nodes from the parse tree. (_xNIL has no special action, but serves as documentation for the rule writer.)


Match an alphabetic token, including accented and other extended ANSI chars.


Match control and nonalphabetic extended ANSI characters. (See _xALPHA.)


Match a numeric token.


Match a punctuation token.


Match a whitespace token, including newline.


Match a whitespace token, excluding newline. Equivalent to _xWILD [match=(\ \t)]


Match an alphabetic with uppercase first letter.


Match an alphabetic consisting of a single capitalized letter. NEW


Match an alphabetic consisting of a single letter. NEW


Match the end of file.


Match if at the start of a phrase (or "segment").


Match if at the end of a phrase (or "segment").

See Also

Phrase Element Modifiers
Suggested Element Modifiers

Rule Syntax