[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Changes to grep/manual/html_node/Character-Classes-and-Bracket-Expressio
From: |
Jim Meyering |
Subject: |
Changes to grep/manual/html_node/Character-Classes-and-Bracket-Expressions.html, v |
Date: |
Sun, 23 Nov 2014 22:23:38 +0000 |
CVSROOT: /webcvs/grep
Module name: grep
Changes by: Jim Meyering <meyering> 14/11/23 22:23:33
Index: html_node/Character-Classes-and-Bracket-Expressions.html
===================================================================
RCS file:
/webcvs/grep/grep/manual/html_node/Character-Classes-and-Bracket-Expressions.html,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- html_node/Character-Classes-and-Bracket-Expressions.html 3 Jun 2014
14:47:02 -0000 1.19
+++ html_node/Character-Classes-and-Bracket-Expressions.html 23 Nov 2014
22:23:30 -0000 1.20
@@ -1,8 +1,8 @@
<html lang="en">
<head>
-<title>Character Classes and Bracket Expressions - GNU Grep 2.20</title>
+<title>Character Classes and Bracket Expressions - GNU Grep 2.21</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<meta name="description" content="GNU Grep 2.20">
+<meta name="description" content="GNU Grep 2.21">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Regular-Expressions.html#Regular-Expressions"
title="Regular Expressions">
@@ -47,7 +47,7 @@
<h3 class="section">3.2 Character Classes and Bracket Expressions</h3>
-<p><a name="index-bracket-expression-212"></a><a
name="index-character-class-213"></a>A <dfn>bracket expression</dfn> is a list
of characters enclosed by ‘<samp><span
class="samp">[</span></samp>’ and
+<p><a name="index-bracket-expression-217"></a><a
name="index-character-class-218"></a>A <dfn>bracket expression</dfn> is a list
of characters enclosed by ‘<samp><span
class="samp">[</span></samp>’ and
‘<samp><span class="samp">]</span></samp>’.
It matches any single character in that list;
if the first character of the list is the caret ‘<samp><span
class="samp">^</span></samp>’,
@@ -55,7 +55,7 @@
For example, the regular expression
‘<samp><span class="samp">[0123456789]</span></samp>’ matches any
single digit.
- <p><a name="index-range-expression-214"></a>Within a bracket expression, a
<dfn>range expression</dfn> consists of two
+ <p><a name="index-range-expression-219"></a>Within a bracket expression, a
<dfn>range expression</dfn> consists of two
characters separated by a hyphen.
It matches any single character that
sorts between the two characters, inclusive.
@@ -71,52 +71,54 @@
<p>Finally, certain named classes of characters are predefined within
bracket expressions, as follows.
-Their interpretation depends on the <code>LC_CTYPE</code> locale;
+Their interpretation depends on the <samp><span
class="env">LC_CTYPE</span></samp> locale;
for example, ‘<samp><span class="samp">[[:alnum:]]</span></samp>’
means the character class of numbers and letters
in the current locale.
- <p><a name="index-classes-of-characters-215"></a><a
name="index-character-classes-216"></a>
+ <p><a name="index-classes-of-characters-220"></a><a
name="index-character-classes-221"></a>
<dl>
-<dt>‘<samp><span class="samp">[:alnum:]</span></samp>’<dd><a
name="index-alnum-_0040r_007bcharacter-class_007d-217"></a><a
name="index-alphanumeric-characters-218"></a>Alphanumeric characters:
-‘<samp><span class="samp">[:alpha:]</span></samp>’ and
‘<samp><span class="samp">[:digit:]</span></samp>’; in the
‘<samp><span class="samp">C</span></samp>’ locale and ASCII
character encoding, this is the same as ‘<samp><span
class="samp">[0-9A-Za-z]</span></samp>’.
+<dt>‘<samp><span class="samp">[:alnum:]</span></samp>’<dd><a
name="index-alnum-_0040r_007bcharacter-class_007d-222"></a><a
name="index-alphanumeric-characters-223"></a>Alphanumeric characters:
+‘<samp><span class="samp">[:alpha:]</span></samp>’ and
‘<samp><span class="samp">[:digit:]</span></samp>’; in the
‘<samp><span class="samp">C</span></samp>’ locale and ASCII
+character encoding, this is the same as ‘<samp><span
class="samp">[0-9A-Za-z]</span></samp>’.
+
+ <br><dt>‘<samp><span
class="samp">[:alpha:]</span></samp>’<dd><a
name="index-alpha-_0040r_007bcharacter-class_007d-224"></a><a
name="index-alphabetic-characters-225"></a>Alphabetic characters:
+‘<samp><span class="samp">[:lower:]</span></samp>’ and
‘<samp><span class="samp">[:upper:]</span></samp>’; in the
‘<samp><span class="samp">C</span></samp>’ locale and ASCII
+character encoding, this is the same as ‘<samp><span
class="samp">[A-Za-z]</span></samp>’.
- <br><dt>‘<samp><span
class="samp">[:alpha:]</span></samp>’<dd><a
name="index-alpha-_0040r_007bcharacter-class_007d-219"></a><a
name="index-alphabetic-characters-220"></a>Alphabetic characters:
-‘<samp><span class="samp">[:lower:]</span></samp>’ and
‘<samp><span class="samp">[:upper:]</span></samp>’; in the
‘<samp><span class="samp">C</span></samp>’ locale and ASCII
character encoding, this is the same as ‘<samp><span
class="samp">[A-Za-z]</span></samp>’.
-
- <br><dt>‘<samp><span
class="samp">[:blank:]</span></samp>’<dd><a
name="index-blank-_0040r_007bcharacter-class_007d-221"></a><a
name="index-blank-characters-222"></a>Blank characters:
+ <br><dt>‘<samp><span
class="samp">[:blank:]</span></samp>’<dd><a
name="index-blank-_0040r_007bcharacter-class_007d-226"></a><a
name="index-blank-characters-227"></a>Blank characters:
space and tab.
- <br><dt>‘<samp><span
class="samp">[:cntrl:]</span></samp>’<dd><a
name="index-cntrl-_0040r_007bcharacter-class_007d-223"></a><a
name="index-control-characters-224"></a>Control characters.
+ <br><dt>‘<samp><span
class="samp">[:cntrl:]</span></samp>’<dd><a
name="index-cntrl-_0040r_007bcharacter-class_007d-228"></a><a
name="index-control-characters-229"></a>Control characters.
In ASCII, these characters have octal codes 000
-through 037, and 177 (<code>DEL</code>).
+through 037, and 177 (DEL).
In other character sets, these are
the equivalent characters, if any.
- <br><dt>‘<samp><span
class="samp">[:digit:]</span></samp>’<dd><a
name="index-digit-_0040r_007bcharacter-class_007d-225"></a><a
name="index-digit-characters-226"></a><a
name="index-numeric-characters-227"></a>Digits: <code>0 1 2 3 4 5 6 7 8
9</code>.
+ <br><dt>‘<samp><span
class="samp">[:digit:]</span></samp>’<dd><a
name="index-digit-_0040r_007bcharacter-class_007d-230"></a><a
name="index-digit-characters-231"></a><a
name="index-numeric-characters-232"></a>Digits: <code>0 1 2 3 4 5 6 7 8
9</code>.
- <br><dt>‘<samp><span
class="samp">[:graph:]</span></samp>’<dd><a
name="index-graph-_0040r_007bcharacter-class_007d-228"></a><a
name="index-graphic-characters-229"></a>Graphical characters:
+ <br><dt>‘<samp><span
class="samp">[:graph:]</span></samp>’<dd><a
name="index-graph-_0040r_007bcharacter-class_007d-233"></a><a
name="index-graphic-characters-234"></a>Graphical characters:
‘<samp><span class="samp">[:alnum:]</span></samp>’ and
‘<samp><span class="samp">[:punct:]</span></samp>’.
- <br><dt>‘<samp><span
class="samp">[:lower:]</span></samp>’<dd><a
name="index-lower-_0040r_007bcharacter-class_007d-230"></a><a
name="index-lower_002dcase-letters-231"></a>Lower-case letters; in the
‘<samp><span class="samp">C</span></samp>’ locale and ASCII
character
+ <br><dt>‘<samp><span
class="samp">[:lower:]</span></samp>’<dd><a
name="index-lower-_0040r_007bcharacter-class_007d-235"></a><a
name="index-lower_002dcase-letters-236"></a>Lower-case letters; in the
‘<samp><span class="samp">C</span></samp>’ locale and ASCII
character
encoding, this is
<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>.
- <br><dt>‘<samp><span
class="samp">[:print:]</span></samp>’<dd><a
name="index-print-_0040r_007bcharacter-class_007d-232"></a><a
name="index-printable-characters-233"></a>Printable characters:
+ <br><dt>‘<samp><span
class="samp">[:print:]</span></samp>’<dd><a
name="index-print-_0040r_007bcharacter-class_007d-237"></a><a
name="index-printable-characters-238"></a>Printable characters:
‘<samp><span class="samp">[:alnum:]</span></samp>’,
‘<samp><span class="samp">[:punct:]</span></samp>’, and space.
- <br><dt>‘<samp><span
class="samp">[:punct:]</span></samp>’<dd><a
name="index-punct-_0040r_007bcharacter-class_007d-234"></a><a
name="index-punctuation-characters-235"></a>Punctuation characters; in the
‘<samp><span class="samp">C</span></samp>’ locale and ASCII
character
+ <br><dt>‘<samp><span
class="samp">[:punct:]</span></samp>’<dd><a
name="index-punct-_0040r_007bcharacter-class_007d-239"></a><a
name="index-punctuation-characters-240"></a>Punctuation characters; in the
‘<samp><span class="samp">C</span></samp>’ locale and ASCII
character
encoding, this is
<code>! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | }
~</code>.
- <br><dt>‘<samp><span
class="samp">[:space:]</span></samp>’<dd><a
name="index-space-_0040r_007bcharacter-class_007d-236"></a><a
name="index-space-characters-237"></a><a
name="index-whitespace-characters-238"></a>Space characters: in the
‘<samp><span class="samp">C</span></samp>’ locale, this is
+ <br><dt>‘<samp><span
class="samp">[:space:]</span></samp>’<dd><a
name="index-space-_0040r_007bcharacter-class_007d-241"></a><a
name="index-space-characters-242"></a><a
name="index-whitespace-characters-243"></a>Space characters: in the
‘<samp><span class="samp">C</span></samp>’ locale, this is
tab, newline, vertical tab, form feed, carriage return, and space.
See <a href="Usage.html#Usage">Usage</a>, for more discussion of matching
newlines.
- <br><dt>‘<samp><span
class="samp">[:upper:]</span></samp>’<dd><a
name="index-upper-_0040r_007bcharacter-class_007d-239"></a><a
name="index-upper_002dcase-letters-240"></a>Upper-case letters: in the
‘<samp><span class="samp">C</span></samp>’ locale and ASCII
character
+ <br><dt>‘<samp><span
class="samp">[:upper:]</span></samp>’<dd><a
name="index-upper-_0040r_007bcharacter-class_007d-244"></a><a
name="index-upper_002dcase-letters-245"></a>Upper-case letters: in the
‘<samp><span class="samp">C</span></samp>’ locale and ASCII
character
encoding, this is
<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>.
- <br><dt>‘<samp><span
class="samp">[:xdigit:]</span></samp>’<dd><a
name="index-xdigit-_0040r_007bcharacter-class_007d-241"></a><a
name="index-xdigit-class-242"></a><a
name="index-hexadecimal-digits-243"></a>Hexadecimal digits:
+ <br><dt>‘<samp><span
class="samp">[:xdigit:]</span></samp>’<dd><a
name="index-xdigit-_0040r_007bcharacter-class_007d-246"></a><a
name="index-xdigit-class-247"></a><a
name="index-hexadecimal-digits-248"></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>.
</dl>
@@ -128,7 +130,7 @@
GNU <samp><span class="command">grep</span></samp> prints a diagnostic and
exits with status 2, on
the assumption that you did not intend to search for the nominally
equivalent regular expression: ‘<samp><span
class="samp">[:epru]</span></samp>’.
-Set the <code>POSIXLY_CORRECT</code> environment variable to disable this
feature.
+Set the <samp><span class="env">POSIXLY_CORRECT</span></samp> environment
variable to disable this feature.
<p>Most meta-characters lose their special meaning inside bracket
expressions.
@@ -145,7 +147,8 @@
<br><dt>‘<samp><span
class="samp">=]</span></samp>’<dd>represents the close equivalence class.
- <br><dt>‘<samp><span
class="samp">[:</span></samp>’<dd>represents the open character class
symbol, and should be followed by a valid character class name.
+ <br><dt>‘<samp><span
class="samp">[:</span></samp>’<dd>represents the open character class
symbol, and should be followed by a
+valid character class name.
<br><dt>‘<samp><span
class="samp">:]</span></samp>’<dd>represents the close character class
symbol.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Changes to grep/manual/html_node/Character-Classes-and-Bracket-Expressions.html, v,
Jim Meyering <=