Anchors and Word Boundaries
The following characters match a position in the string or paragraph instead of one or more characters:
• Placing the circumflex ^ before the search characters matches characters occurring at the beginning of a string or paragraph. For example, /^Java/ matches strings that begin with “Java” but not ones that contain “Java” after the first character.
|
If ^ appears first inside square brackets, it means negation.
|
• Placing the dollar sign $ after the search characters matches characters occurring at the end of a string or paragraph. For example, /y$/ matches anything that ends in “y”, and /9$/ matches anything that ends in “9”.
• The combination \b matches a word boundary. For example, specifying /\bJava\b/ finds the standalone word “Java” but not “JavaScript”.
|
In the Arbortext implementation, the [\b] combination does not match a backspace character.
|
Because line breaks are not normally relevant or maintained when editing XML document content, the ^ and $ anchor characters in a regular expression match paragraph instead of line boundaries when matching document content (for example, when using the find command). Paragraph elements are defined in the document type configuration file (.dcf) for the document type.