Chapter 7

Special Characters


Table 3. Special Characters for Pattern Searches.

Character Name Example and Meaning
^ Left Anchor
^mentor
Find all instances of "mentor" that occur at the beginning of a text unit.
$ Right Anchor
$mentor
Find all instances of "mentor" that are found at the end of a text unit.
[] Alternation
start and end
ment[ee|or|ored|oring|orship]
Square brackets are used to enclose aternate expressions. The above example would find all occurrences of mentee, mentor, mentored, mentoring and mentorship.
| String
alternation
divider
[Sue|Susan|Susie]
The divider separates different iterations of a word. The example above would find all occurrences of Sue, Susan, or Susie.
- Character
range
alternation
[1-9]
Finds a match for the occurrence of any single digit between 1 and 9.
[Lauren|1-9]
Matches 'Lauren' OR any digit.
~ Negated
character
alternation
When used as the first character searches for a match with any character other than those specified.
[~AEIOUaeiou]
Matches any character except a vowel.
[~0-9]
Matches any character except a digit.
[Lauren|~AEIOUaeiou]
Finds matches for "Lauren" or any character that isn't a vowel.

.

(period)

Spanning
Wild-card
l.ve
Will find live and love. The period (or dot) matches any one character.
f..t
Will find foot, feet, fist, felt, fast, feat, etc. Finds any two characters preceded by 'f' and followed by 't'.
# Repetition
Wild Card
Zero or ONE
Matches the preceding character one or zero times.
colou#r
Finds all occurrences of color and colour by allowing the preceding character or grouping to match or be ignored (match 0 or 1 times).
Mr*s.
Finds Ms. or Mrs.
[Ms|Miss|Mrs]#Lauren
Finds any of the salutations followed by Lauren
* Repetition
Wild Card
Zero or MORE
Matches the preceding character many or zero times.
$20*
Matches $2, $20, $200, $2000, etc. Finds '2' followed by zero or more occurences of '0'.
61*
Matches '6' followed by zero or more occurrences of '1'
an*
Matches 'a' followed by zero or more occurences of 'n'
timelines*
Matches 'timeline' followed by zero or more occurences of 's'
+ Repetition
Wild Card
One or MORE
Matches the preceding character, or range of characters, one or more times.
$20+bill
Matches '$20 bill', '$200 bill', '$2000 bill', etc. Finds '2' followed by one or more occurences of '0'. Will not match '$2 bill'.
$[0-9]+bill
Finds '$', followed by any sequence of numbers, followed by 'bill'.
()

Grouping
Start and End

Used to frame a 'grouping' - a pattern or string - for use with a Repitition Wild Card. The wild card then applies to the whole pattern or string rather than a single character.
\ Escape

When placed in front of a special character in a pattern, the special character is treated literally; otherwise it is ignored.

^n.*n[n|n]

(where 'n' equals a text pattern)
Combinations
of
Characters
^Dorothy:.*I [wish|want|think]
Finds a left anchored pattern beginning with 'Dorothy:' followed by any sequence of zero or more characters - followed by 'I' - followed by 'wish' or 'want' or 'think'



Copyright Bobbi A. Kerlin, Ph.D.
http://kerlins.net/bobbi/research/nudist/
Last updated February 10, 2002