\section{Search Arguments}
\label{Search Arguments}

     TECO builds the search string by loading its search string buffer
     from  the  supplied  search  command argument.  To help you enter
     special characters or frequently used  character  sequences,  the
     argument  may  contain special string building characters.  Table
     \ref{String Building Characters} lists the string building characters and their functions.

     TECO-8 does not support the extended String  Build  functions  or
     Match  Control  Constructs  that  begin with {\tt <CTRL/E>}.  This is a
     general property and  will  not  be  repeated  in  the  following
     tables.

     Note that, as explained in Chapter \ref{Conventions and Structures}, a 
	caret (\caret)  may  be
     used to indicate that the character following it is to be treated
     as a control character.  Any of the commands below may be entered
     using  the  caret.  This function of the caret can be disabled by
     using the ED flag (see~\ref{Mode Control Flags} and appendices).


\begin{table}[h]
\caption{\bf{String Building Characters}}
\label{String Building Characters}
	
\end{table}
\nopagebreak

\begin{list}{}{\labelsep 20pt}

     \item [CHARACTER]           FUNCTION

     \item [{\tt <CTRL/Q>}]       A {\tt <CTRL/Q>} character in a search command  argument
                    indicates   that   the   character  following  the
                    {\tt <CTRL/Q>} is to be used literally rather than as  a
                    match control character.

     \item [{\tt <CTRL/R>}]       Same as {\tt <CTRL/Q>}.

     \item [{\tt <CTRL/V>}]       A {\tt <CTRL/V>} character in a search command  argument
                    indicates   that   the   character  following  the
                    {\tt <CTRL/V>} is to be used as the equivalent character
                    in  the lower case ASCII range (i.e., octal 100 to
                    137 is treated as octal 140 to 177).

\iftecotenonly
     \item [{\tt <CTRL/V><CTRL/V>}]
                    Two successive {\tt <CTRL/V>}  characters  in  a  string
                    argument  indicate  to  TECO  that  all  following
                    alphabetic characters in this  string  are  to  be
                    converted  to  lower case unless an explicit \caret {\tt W}
		    is given  to  override  this   state.    This   state
                    continues  until  the end of the string or until a
                    \caret {\tt W} \caret {\tt W} construct is encountered.
                    {\em [TECO-10 only]}
\fi

     \item [{\tt <CTRL/W>}]       A {\tt <CTRL/W>} character in a search command  argument
                    indicates   that   the   character  following  the
                    {\tt <CTRL/W>} is to be used as the equivalent character
                    in  the upper case ASCII range (i.e., octal 140 to
                    177 is treated as octal 100 to 137).

\iftecotenonly
     \item [{\tt <CTRL/W><CTRL/W>}]
                    Two successive {\tt <CTRL/W>}  characters  indicates  to
                    TECO  that  all following alphabetic characters in
                    this string are to  be  converted  to  upper  case
                    unless  an  explicit \caret {\tt V} is encountered to override
                    this state.  This state continues until the end of
                    the   string   or   until   a  \caret {\tt V}\caret {\tt V}
		  construct  is
                    encountered.
                    {\em [TECO-10 only]}
\fi

\ifnotintecoten
     \item [{\tt <CTRL/E>Qq}]     {\tt <CTRL/E>Qq} indicates that  the  string  stored  in
                    Q-register  q  is  to  be  used  in  the  position
                    occupied by the \caret {\tt EQq}  in  the  search  string.   Q
                    registers are discussed in sections \ref{Q-registers} and 
	\ref{Q-register Manipulation}.
                    {\em [Not in TECO-10]}
\fi

\iftecoelevenonly
     \item [{\tt <CTRL/E>Uq}]     A {\tt <CTRL/E>Uq}  indicates  that  the  character  whose
                    ASCII  code  is  specified  by the numeric storage
                    area of Q-register q is to be used in the position
                    occupied by the \caret {\tt EUq} in the search string.
                    {\em [TECO-11 only]}
\fi

\end{list}

     String build characters are  also  permitted  inside  the  string
     arguments of the {\tt O}, {\tt EB}, {\tt ER}, {\tt EW}, and {\tt EG} commands.

     TECO executes a search command by attempting to match the  search
     command  argument character-by-character with some portion of the
     input file.  There are several special  control  characters  that
     may  be  used  in  search  command  arguments  to alter the usual
     matching  process.   Table ~\ref{Match Control Characters}  lists   these   match   control
     characters and their functions.


\begin{table}[h]
\caption{\bf{Match Control Characters}}
\label{Match Control Characters}
\end{table}
\nopagebreak
            
\begin{list}{}{\labelsep 20pt}

     \item [CHARACTER]           FUNCTION

     \item [{\tt <CTRL/X>}]       A {\tt <CTRL/X>} character indicates that this  position
                    in  the  character  string  may  be any character.
                    TECO  accepts  any  character  as  a   match   for
                    {\tt <CTRL/X>}.

     \item [{\tt <CTRL/S>}]       A {\tt <CTRL/S>} character indicates that any  separator
                    character  is  acceptable  in this position.  TECO
                    accepts any character that is not a letter  (upper
                    or  lower  case  A  to Z) or a digit (0 to 9) as a
                    match for {\tt <CTRL/S>}.

     \item [{\tt <CTRL/N>}x]      TECO accepts any character  as  a  match  for  the
                    {\tt <CTRL/N>}x  combination  EXCEPT the character which
                    follows the {\tt <CTRL/N>}.  {\tt <CTRL/N>}  can  be  combined
                    with  other  special characters.  For example, the
                    combination {\tt <CTRL/N><CTRL/E>D} means match anything
                    except a digit in this position.

     \item [{\tt <CTRL/E>A}]      {\tt <CTRL/E>A} indicates that any alphabetic  character
                    (upper or lower case {\tt A} to {\tt Z}) is acceptable in this
                    position.

     \item [{\tt <CTRL/E>B}]      Same as {\tt <CTRL/S>}.

     \item [{\tt <CTRL/E>C}]      {\tt <CTRL/E>C} indicates that  any  character  that  is
                    legal   as   part   of  a  symbol  constituent  is
                    acceptable in this  position.   TECO  accepts  any
                    letter  (upper or lower case {\tt A} to {\tt Z}), any digit ({\tt 0}
                    to {\tt 9}), a dot ({\tt .}), or a dollar sign ({\tt \$}) as a  match
                    for   {\tt <CTRL/E>C}.   Additional  characters  may  be
                    matched  depending  upon  the  operating   system;
                    consult the appropriate appendix.

     \item [{\tt <CTRL/E>D}]      {\tt <CTRL/E>D} indicates that any digit  ({\tt 0}  to  {\tt 9})  is
                    acceptable in this position.

\ifnotintecoten
     \item [{\tt <CTRL/E>Gq}]     {\tt <CTRL/E>Gq} indicates that any character  contained
                    in  Q-register  q  is acceptable in this position.
                    For example, if Q-register A contains  {\tt A*:}  then
                    TECO  accepts  either  {\tt A},  {\tt *}, or {\tt :}  as a match for
                    {\tt <CTRL/E>GA}.
                    {\em [Not in TECO-10]}
\fi

     \item [{\tt <CTRL/E>L}]      {\tt <CTRL/E>L} indicates that any line terminator (line
                    feed, vertical tab, or form feed) is acceptable in
                    the position occupied by {\tt <CTRL/E>L} in  the  search
                    string.

\iftecotenonly
     \item [{\tt <CTRL/E>M}]      {\tt <CTRL/E>M} indicates that any  
			non-zero  number  of
                    occurrences of the immediately following character
                    or match control construct is acceptable  at  this
                    position.
                    {\em [TECO-10 only]}
\fi

     \item [{\tt <CTRL/E>R}]      {\tt <CTRL/E>R}   indicates   that   
		any    alphanumeric
                    character  (letter  or  digit as defined above) is
                    acceptable in this position.

     \item [{\tt <CTRL/E>S}]      {\tt <CTRL/E>S} indicates that any  
		non-null  string  of
                    spaces  and/or  tabs is acceptable in the position
                    occupied by {\tt <CTRL/E>S}.

     \item [{\tt <CTRL/E>V}]      {\tt <CTRL/E>V} indicates that any lower 
			case alphabetic
                    character is acceptable in this position.

     \item [{\tt <CTRL/E>W}]      {\tt <CTRL/E>W} indicates that any 
		upper case alphabetic
                    character is acceptable in this position.

     \item [{\tt <CTRL/E>X}]      Equivalent to {\tt <CTRL/X>}.

\iftecotenonly
     \item [{\tt <CTRL/E><nnn>}]  {\tt <CTRL/E><nnn>} indicates that the  
		character  whose
                    ASCII  octal  code  is  nnn  is acceptable in this
                    position.
                    {\em [TECO-10 only]}

     \item [{\tt <CTRL/E>[a,b,c,...]}]
                    {\tt <CTRL/E>[a,b,c,...]} indicates that any one of  the
                    specified   characters   is   acceptable  in  this
                    position.  One or more characters or  other  match
                    control constructs are permitted.
                    {\em [TECO-10 only]}
\fi

     TECO-8 uses special symbols to represent  certain  match  control
     characters  when  they  are displayed by an error message.  These
     display symbols are:
\end{list}

\begin{tabular}{ll}

          {\em Character}      &	{\em Display} \\
\medskip
          \caret {\tt N} &            {\tt <NOT>} \\
          \caret {\tt S}             & {\tt <SEP>} \\
          \caret {\tt X}             & {\tt <ANY>} \\

\end{tabular}
