Search

Thursday, June 18, 2009

Option Meaning

A circumflex at the start of the expression matches the start of a
line.
$ A dollar sign at the end of the expression matches the end of a
line.
. A period matches any character.
* An expression followed by an asterisk wildcard matches zero or more
occurrences of that expression. For example, in to*, the * operates
on the expression o; it matches t, to, too, etc. (t followed by zero
or more os), but doesn't match ta.
+ An expression followed by a plus sign matches one or more
occurrences of that expression: to+ matches to, too, etc., but not
t.
[ ] A string enclosed in brackets matches any character in that string,
but no others. If the first character in the string is a circumflex
(^), the expression matches any character except the characters in
the string.
For example, [xyz] matches x, y, or z, while [^xyz] matches a and b,
but not x, y, or z. You can specify a range of characters with two
characters separated by a hyphen (-). These can be combined to form
expressions (like [a-bd-z?], which matches the ? character and any
lowercase letter except c).
\ The backslash escape character tells GREP to search for the literal
character that follows it. For example, \. matches a period instead
of "any character." The backslash can be used to quote itself; that
is, you can use \\ to indicate a literal backslash character in a
GREP expression.

No comments:

Post a Comment