CVSROOT: /web/grep Module name: grep Changes by: Karl Berry <karl> 09/05/24 18:43:01
Index: doc/grep_8.html =================================================================== RCS file: doc/grep_8.html diff -N doc/grep_8.html --- doc/grep_8.html 23 Jan 2002 10:33:52 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,238 +0,0 @@ -<HTML> -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<!-- Created on January, 23 2002 by texi2html 1.64 --> -<!-- -Written by: Lionel Cons <[email protected]> (original author) - Karl Berry <[email protected]> - Olaf Bachmann <[email protected]> - and many others. -Maintained by: Olaf Bachmann <[email protected]> -Send bugs and suggestions to <[email protected]> - ---> -<HEAD> -<TITLE>grep, print lines matching a pattern: 5.1 Character Class</TITLE> - -<META NAME="description" CONTENT="grep, print lines matching a pattern: 5.1 Character Class"> -<META NAME="keywords" CONTENT="grep, print lines matching a pattern: 5.1 Character Class"> -<META NAME="resource-type" CONTENT="document"> -<META NAME="distribution" CONTENT="global"> -<META NAME="Generator" CONTENT="texi2html 1.64"> - -</HEAD> - -<BODY LANG="" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000"> - -<A NAME="SEC8"></A> -<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> -<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="grep_7.html#SEC7"> < </A>]</TD> -<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="grep_9.html#SEC9"> > </A>]</TD> -<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="grep_7.html#SEC7"> << </A>]</TD> -<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="grep_7.html#SEC7"> Up </A>]</TD> -<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="grep_13.html#SEC13"> >> </A>]</TD> -<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="grep.html#SEC_Top">Top</A>]</TD> -<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="grep_toc.html#SEC_Contents">Contents</A>]</TD> -<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="grep_21.html#SEC21">Index</A>]</TD> -<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="grep_abt.html#SEC_About"> ? </A>]</TD> -</TR></TABLE> -<HR SIZE=1> -<H2> 5.1 Character Class </H2> -<!--docid::SEC8::--> -<P> - -<A NAME="IDX176"></A> -<A NAME="IDX177"></A> -A <EM>bracket expression</EM> is a list of characters enclosed by <SAMP>`['</SAMP> and -<SAMP>`]'</SAMP>. It matches any single character in that list; if the first -character of the list is the caret <SAMP>`^'</SAMP>, then it matches any character -<STRONG>not</STRONG> in the list. For example, the regular expression -<SAMP>`[0123456789]'</SAMP> matches any single digit. -</P><P> - -<A NAME="IDX178"></A> -Within a bracket expression, a <EM>range expression</EM> consists of two -characters separated by a hyphen. It matches any single character that -sorts between the two characters, inclusive, using the locale's -collating sequence and character set. For example, in the default C -locale, <SAMP>`[a-d]'</SAMP> is equivalent to <SAMP>`[abcd]'</SAMP>. Many locales sort -characters in dictionary order, and in these locales <SAMP>`[a-d]'</SAMP> is -typically not equivalent to <SAMP>`[abcd]'</SAMP>; it might be equivalent to -<SAMP>`[aBbCcDd]'</SAMP>, for example. To obtain the traditional interpretation -of bracket expressions, you can use the C locale by setting the -<CODE>LC_ALL</CODE> environment variable to the value <SAMP>`C'</SAMP>. -</P><P> - -Finally, certain named classes of characters are predefined within -bracket expressions, as follows. -Their interpretation depends on the <CODE>LC_CTYPE</CODE> locale; the -interpretation below is that of the C locale, which is the default -if no <CODE>LC_CTYPE</CODE> locale is specified. -</P><P> - -<A NAME="IDX179"></A> -<A NAME="IDX180"></A> -<DL COMPACT> - -<DT><SAMP>`[:alnum:]'</SAMP> -<DD><A NAME="IDX181"></A> -<A NAME="IDX182"></A> -Alphanumeric characters: -<SAMP>`[:alpha:]'</SAMP> and <SAMP>`[:digit:]'</SAMP>. -<P> - -<DT><SAMP>`[:alpha:]'</SAMP> -<DD><A NAME="IDX183"></A> -<A NAME="IDX184"></A> -Alphabetic characters: -<SAMP>`[:lower:]'</SAMP> and <SAMP>`[:upper:]'</SAMP>. -<P> - -<DT><SAMP>`[:blank:]'</SAMP> -<DD><A NAME="IDX185"></A> -<A NAME="IDX186"></A> -Blank characters: -space and tab. -<P> - -<DT><SAMP>`[:cntrl:]'</SAMP> -<DD><A NAME="IDX187"></A> -<A NAME="IDX188"></A> -Control characters. In ASCII, these characters have octal codes 000 -through 037, and 177 (<CODE>DEL</CODE>). In other character sets, these are -the equivalent characters, if any. -<P> - -<DT><SAMP>`[:digit:]'</SAMP> -<DD><A NAME="IDX189"></A> -<A NAME="IDX190"></A> -<A NAME="IDX191"></A> -Digits: <CODE>0 1 2 3 4 5 6 7 8 9</CODE>. -<P> - -<DT><SAMP>`[:graph:]'</SAMP> -<DD><A NAME="IDX192"></A> -<A NAME="IDX193"></A> -Graphical characters: -<SAMP>`[:alnum:]'</SAMP> and <SAMP>`[:punct:]'</SAMP>. -<P> - -<DT><SAMP>`[:lower:]'</SAMP> -<DD><A NAME="IDX194"></A> -<A NAME="IDX195"></A> -Lower-case letters: -<CODE>a b c d e f g h i j k l m n o p q r s t u v w x y z</CODE>. -<P> - -<DT><SAMP>`[:print:]'</SAMP> -<DD><A NAME="IDX196"></A> -<A NAME="IDX197"></A> -Printable characters: -<SAMP>`[:alnum:]'</SAMP>, <SAMP>`[:punct:]'</SAMP>, and space. -<P> - -<DT><SAMP>`[:punct:]'</SAMP> -<DD><A NAME="IDX198"></A> -<A NAME="IDX199"></A> -Punctuation characters: -<CODE>! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~</CODE>. -<P> - -<DT><SAMP>`[:space:]'</SAMP> -<DD><A NAME="IDX200"></A> -<A NAME="IDX201"></A> -<A NAME="IDX202"></A> -Space characters: -tab, newline, vertical tab, form feed, carriage return, and space. -<P> - -<DT><SAMP>`[:upper:]'</SAMP> -<DD><A NAME="IDX203"></A> -<A NAME="IDX204"></A> -Upper-case letters: -<CODE>A B C D E F G H I J K L M N O P Q R S T U V W X Y Z</CODE>. -<P> - -<DT><SAMP>`[:xdigit:]'</SAMP> -<DD><A NAME="IDX205"></A> -<A NAME="IDX206"></A> -<A NAME="IDX207"></A> -Hexadecimal digits: -<CODE>0 1 2 3 4 5 6 7 8 9 A B C D E F a b c d e f</CODE>. -<P> - -</DL> -For example, <SAMP>`[[:alnum:]]'</SAMP> means <SAMP>`[0-9A-Za-z]'</SAMP>, except the latter -depends upon the C locale and the ASCII character -encoding, whereas the former is independent of locale and character set. -(Note that the brackets in these class names are -part of the symbolic names, and must be included in addition to -the brackets delimiting the bracket list.) -<P> - -Most metacharacters lose their special meaning inside lists. -</P><P> - -<DL COMPACT> -<DT><SAMP>`]'</SAMP> -<DD>ends the list if it's not the first list item. So, if you want to make -the <SAMP>`]'</SAMP> character a list item, you must put it first. -<P> - -<DT><SAMP>`[.'</SAMP> -<DD>represents the open collating symbol. -<P> - -<DT><SAMP>`.]'</SAMP> -<DD>represents the close collating symbol. -<P> - -<DT><SAMP>`[='</SAMP> -<DD>represents the open equivalence class. -<P> - -<DT><SAMP>`=]'</SAMP> -<DD>represents the close equivalence class. -<P> - -<DT><SAMP>`[:'</SAMP> -<DD>represents the open character class followed by a valid character class name. -<P> - -<DT><SAMP>`:]'</SAMP> -<DD>represents the close character class followed by a valid character class name. -<P> - -<DT><SAMP>`-'</SAMP> -<DD>represents the range if it's not first or last in a list or the ending point -of a range. -<P> - -<DT><SAMP>`^'</SAMP> -<DD>represents the characters not in the list. If you want to make the <SAMP>`^'</SAMP> -character a list item, place it anywhere but first. -<P> - -</DL> -<P> - -<HR SIZE=1> -<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> -<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="grep_7.html#SEC7"> < </A>]</TD> -<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="grep_9.html#SEC9"> > </A>]</TD> -<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="grep_7.html#SEC7"> << </A>]</TD> -<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="grep_7.html#SEC7"> Up </A>]</TD> -<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="grep_13.html#SEC13"> >> </A>]</TD> -<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="grep.html#SEC_Top">Top</A>]</TD> -<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="grep_toc.html#SEC_Contents">Contents</A>]</TD> -<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="grep_21.html#SEC21">Index</A>]</TD> -<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="grep_abt.html#SEC_About"> ? </A>]</TD> -</TR></TABLE> -<BR> -<FONT SIZE="-1"> -This document was generated -by <I>root</I> on <I>January, 23 2002</I> -using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html -"><I>texi2html</I></A> - -</BODY> -</HTML>
