HP Browse/XL User's Guide
4- 22
Special Pattern-Matching Characters. HP Browse has a pattern-matching facility that enables you to
use wildcard and other special characters in order to conduct more sophisticated pattern searches of your
files. You can use any of the pattern-matching characters of HP Browse when you specify a pattern with
the Define Search Pattern function. To signify to HP Browse that you want to use these special matching
characters, set the Use Pattern-Matching Chars to "Yes". If it is set to "No", HP Browse will treat these
characters literally. These special pattern-matching characters are listed below.
Character HP Browse Functionality
^ Matches the beginning of a line when it is the first character of a pattern. Represents "Not in
set" when it is the first character after a left bracket, [. Otherwise, HP Browse treats it liter-
ally. That is, the ^ character matches only other ^ characters.
$ Represents the end of a line when it is the last character of a pattern. Otherwise, it is treated
literally.
( ) Groups portions of apattern. The main use ofparenthesesiswith the vertical bar character.
You must always specify at least one character between left and right parentheses.
| Separates multiple, distinct patterns in a list. Matches any one of the patterns in the list. The
bar character has special meaning only when used inside parentheses, otherwise it is treated
literally. That is, the | character outside of parentheses matches only |.
[ ] Indicates a set of characters. HP Browse attempts to match any one of the characters in the
set. You must always specify at least one character between left and right brackets.
- Signifies a range of alphanumeric characters starting with the character preceding the hy-
phen and ending with the character following the hyphen. The hyphen character has special
meaning only when used inside brackets. However, HP Browse will treat a hyphen literally
inside brackets if it is the first or last character inside the brackets.
+ Matches one or more occurrences of the previous character.
* Matches zero or more occurrences of the previous character.
? Matches exactly one of any character.
?+ Matches one or more characters.
# Matches exactly one of any digit.
@ Matches 0 or more number of unspecified characters. (Equivalent to ?*).
\ Causes any subsequent character to be interpreted literally.
If you want to search your file for occurrences of the word "BUF", regardless of surrounding characters, you
can simply type
BUFReturn
after pressing the Define Search function key. The pattern "BUF" contains no wildcard or pattern-
matching characters. It specifies only the word "BUF". However, using pattern-matching characters, you
can create many other search strings. Some examples are shown below.
Syntax Pattern Specified
^The Any line starting with the word "The".
\^The The string "^The".