Appendix B - Regular Expressions
|Top Previous Next|
Regular Expressions can be considered a programming language that was specifically designed for string processing. Its main purpose is to locate patterns of substrings within a larger string, according to relative position, context, case and many other attributes.
To achieve this, the Regular Expressions language recognizes a set of special characters that can be compared in functionality to the wildcard characters * and ? in the DOS environment. The language employs many of these special characters to provide endless possibilities when searching for a certain pattern within a string. There's also a system for grouping parts of substrings and intermediate results during a search operation.
z/Scope takes advantage of the power and simplicity of the Regular Expressions language for defining HotSpots, one of z/Scopes' key features. The creation of a HotSpot requires the user to specify the criteria that a text string in the emulation display must fulfill in order to be recognized and respond to mouse clicks. See Creating/Editing a HotSpot.
Most letters and characters will simply match themselves. For example, the regular expression "engine" will match the string "engine" exactly. However, there are some special characters (usually called metacharacters) that do not match themselves. Instead, they are used to define rules and patterns that will be looked for when analyzing the strings.
Here's a comprehensive list of all available metacharacters:
If you need to search for one of the characters that are reserved as metacharacters, you can do so by placing a backslash (\) before the desired character. In this way, for example, \? will actually match "?" instead of matching the position at the end of the string.