Basic Regular Expressions

Syntax of the builtin regular expression library

BREs differ from EREs in several respects. `$\vert$', `+', and ? are ordinary characters and there is no equivalent for their functionality. The delimiters for bounds are $\backslash${ and `$\backslash$}', with { and } by themselves ordinary characters. The parentheses for nested subexpressions are $\backslash$( and `$\backslash$)', with ( and ) by themselves ordinary characters. ^ is an ordinary character except at the beginning of the RE or the beginning of a parenthesized subexpression, $ is an ordinary character except at the end of the RE or the end of a parenthesized subexpression, and * is an ordinary character if it appears at the beginning of the RE or the beginning of a parenthesized subexpression (after a possible leading `^'). Finally, single-digit back references are available, and $\backslash<$ and $\backslash>$ are synonyms for $[[:<:]]$ and $[[:>:]]$ respectively; no other escapes are available.

ymasuda 平成17年11月19日