[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]


Operators

Table 6.6 shows characters that can become operators with special meanings based on their placement in the regular expression. For more information, see "Find and Replace Using Regular Expressions."

Operator Descriptions:

Operator
Description
"."  
The match-any-character operator matches any single printing or non-printing character except newline and null.  
"*"  
The match-zero-or-more operator replaces the smallest/preceding regular expression with a subexpression.  
"+"  
The match-one-or-more operator repeats the preceding regular expression at least once and then as many times as necessary to match the pattern.  
"?"  
The match-zero-or-one operator repeats the preceding regular expression once or not at all.  
"\n"  
The back-reference operator in the replace string refers to a specified group (unit expression) in the find string. You must enclose each group within parentheses. The digit n must range between 1 and 9. The number identifies a specific group, starting from the left side of the regular expression.  
"|"  
The alternation operator matches one of a choice of regular expressions. If you place the alternation operator between any two regular expressions, the result matches the largest union of strings that it can match.  
"^"  
The match-beginning-of-line operator matches the string from the beginning of the string or after a newline character. When it appears within brackets the "^" represents a List operator. Because List operators do not enforce order, [ab] is the same as [ba].  
"$"  
The match-end-of-line operator matches the string either at the end of the string or before a newline character in the string.  
[]  
List operators enable you to define a set of items to use as a match. You must enclose the list items within square brackets. Note that you cannot define an empty list.  
()  
Group operators define sub-expressions that you can use as a single unit elsewhere in the regular expression.  
"-"  
The range operator defines the characters that fall between the starting and ending characters within the list.  


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: August 17, 2000