13 views

The operator ^ matches the left end of a line, and \$matches the right end of a line. The operator ^ is also used to introduce complemented character classes, but the context always makes it clear which meaning is intended. For example, ^ [^aeiou]* \$ matches any complete line that does not contain a lowercase vowel.

1. How do you tell which meaning of ^ is intended?
2. Can you always replace a regular expression using the ^ and \$ operators by an equivalent expression that does not use either of these operators?
| 13 views