^ Means Findup, Control-Char, Start-of-line (in Regexp) or Negate (in Regexp)

Qedit 5.7 for HP-UX

Home Previous Next


^
Means Findup, Control-Char, Start-of-line (in Regexp) or Negate (in Regexp)

The circumflex character (^) is a short name for the Findup command. In documentation, it often indicates a control character (^A is Control-A). If you are not on an HP terminal, you can use ^1 through ^8 to simulate the user function keys in Line mode. That's circumflex-1, not Control-1!

The circumflex (^) in regular expressions identifies the start of a line. It takes on this meaning only if it is the first character in the regexp. If used as the start-of-line, it indicates that the string must be the first thing on that line for a successful match.

/list "^Once upon" (regexp) {line must start with "Once upon"}

If it used anywhere in the expression and is not preceded by a backslash, it is used as a literal.

If the circumflex (^) in a regular expression is preceded by a backslash (\), it indicates a control-character combination. The character to the right of the circumflex makes up the actual control character.

/list "\^G" (regexp) {Control-G or Bell character}

The circumflex (^) in a character class within regular expressions negates the list of characters in the class. It takes on this meaning only if it is the first character in the class. If used anywhere else in the class, it is used as a literal.

If used as a negation, it indicates that the match is successful if the character in the specified position of the text is not in the class list.

/list "[^abc]" (regexp) {successful if not "a," "b," or "c"}


Home Previous Next