Next: , Previous: , Up: Top   [Contents][Index]


Appendix F Summary of all Regular Expressions

Regular expressions are based on POSIX EREs (Extended Regular Expressions). Regexps are composed of characters. Here is a short-list of them all:

c

matches the character c (assuming c is none of the characters listed below).

\c

matches the literal character c.

.

matches any character.

^

matches the beginning of a string.

$

matches the end of a string.

[abc]

matches any of the characters abc… (character list).

[[:keyword:]]

matches any character in the character class keyword. Allowable classes are alnum, alpha, blank, cntrl, digit, graph, lower, print, punct, space, upper, and xdigit.

[[.element.]]

matches the multi-character collating element. Gcal does not currently support collating symbols.

[[=list=]]

matches any of the equivalent characters in list. Gcal does not currently support equivalence classes.

[^abc]

matches any character except abc… (negated resp. complemented character list).

r1|r2

matches either r1 or r2 (alternation).

r1r2

matches r1, and then r2 (concatenation).

r+

matches one or more r’s.

r*

matches zero or more r’s.

r?

matches zero or one r’s.

(r)

matches r (grouping).

r{n}
r{n,}
r{n,m}

matches at least n, n to any number, or n to m occurrences of r (interval expressions).

\b

matches the empty string at either the beginning or the end of a word.

\B

matches the empty string within a word.

\<

matches the empty string at the beginning of a word.

\>

matches the empty string at the end of a word.

\w

matches any word-constituent character (alphanumeric characters and the underscore).

\W

matches any character that is not word-constituent.

\`

matches the empty string at the beginning of a buffer81.

\'

matches the empty string at the end of a buffer.


Next: , Previous: , Up: Top   [Contents][Index]