Regular Expressions

The KSteak Handbook
Prev | Chapter 3. Usage | Next

# 3.2. Regular Expressions

KSteak accepts regular expressions with the following notation:

c

  a single letter matching itself

.

  a dot matching any letter except line end

\?

  the pattern preceding the operator \? may occur 0 or one time

*

  the pattern preceding the operator * may occur 0 or more times

\+

  the pattern preceding the operator \+ may occur 1 or more times

\|

  arguments combined by operator \| will be or-concatenated

[letters]

  matches all letters; you may specify single letters or ranges of the form "begin-end"; the expression matches all letters except the specified ones, if the first letter after [ is a ^.

\( \)

  braces are collecting expressions; moreover will the matching text of the brace enclosed part of the pattern be marked and can be refered to by the following \N expression (tag).

\N

  refers to the matching text of the pattern which is enclosed by the N-th brace. N must be a number larger than or equal to 2.

  CAUTION: Such requests put a heavy load on the system!

\

  each speacial character - escaped by a \ (backslash) - can match itself. \b matches no letter but the beginning or end of a word.

\B

  matches all letters within a word

\w

  matches all alphanumeric characters [A-Za-z0-9]

\W

  matches all nonalphanumeric characters [^A-Za-z0-9]

The rule of precedence of operators is (ordered by highest to lowest precedence): (, ), ?, *, + and |. All other operators are of equal precedence as characters are.

Prev | Home | Next
Usage | Up | Docking