[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: |
Sat, 14 Aug 2021 16:46:42 -0400 (EDT) |
CVSROOT: /webcvs/grep
Module name: grep
Changes by: Jim Meyering <meyering> 21/08/14 16:46:41
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.31
retrieving revision 1.32
diff -u -b -r1.31 -r1.32
--- html_node/Character-Classes-and-Bracket-Expressions.html 28 Sep 2020
03:36:49 -0000 1.31
+++ html_node/Character-Classes-and-Bracket-Expressions.html 14 Aug 2021
20:46:40 -0000 1.32
@@ -1,8 +1,11 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
+<!-- Created by GNU Texinfo 6.8, https://www.gnu.org/software/texinfo/ -->
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- This manual is for grep, a pattern matching engine.
-Copyright (C) 1999-2002, 2005, 2008-2020 Free Software Foundation,
+Copyright (C) 1999-2002, 2005, 2008-2021 Free Software Foundation,
Inc.
Permission is granted to copy, distribute and/or modify this document
@@ -11,66 +14,56 @@
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
Texts. A copy of the license is included in the section entitled
"GNU Free Documentation License". -->
-<!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>Character Classes and Bracket Expressions (GNU Grep 3.5)</title>
+<title>Character Classes and Bracket Expressions (GNU Grep 3.7)</title>
-<meta name="description" content="Character Classes and Bracket Expressions
(GNU Grep 3.5)">
-<meta name="keywords" content="Character Classes and Bracket Expressions (GNU
Grep 3.5)">
+<meta name="description" content="Character Classes and Bracket Expressions
(GNU Grep 3.7)">
+<meta name="keywords" content="Character Classes and Bracket Expressions (GNU
Grep 3.7)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
-<link href="index.html#Top" rel="start" title="Top">
-<link href="Index.html#Index" rel="index" title="Index">
+<meta name="viewport" content="width=device-width,initial-scale=1">
+
+<link href="index.html" rel="start" title="Top">
+<link href="Index.html" rel="index" title="Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
-<link href="Regular-Expressions.html#Regular-Expressions" rel="up"
title="Regular Expressions">
-<link
href="The-Backslash-Character-and-Special-Expressions.html#The-Backslash-Character-and-Special-Expressions"
rel="next" title="The Backslash Character and Special Expressions">
-<link href="Fundamental-Structure.html#Fundamental-Structure" rel="prev"
title="Fundamental Structure">
+<link href="Regular-Expressions.html" rel="up" title="Regular Expressions">
+<link href="The-Backslash-Character-and-Special-Expressions.html" rel="next"
title="The Backslash Character and Special Expressions">
+<link href="Fundamental-Structure.html" rel="prev" title="Fundamental
Structure">
<style type="text/css">
<!--
+a.copiable-anchor {visibility: hidden; text-decoration: none; line-height: 0em}
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
-blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
-blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
-div.lisp {margin-left: 3.2em}
-div.smalldisplay {margin-left: 3.2em}
-div.smallexample {margin-left: 3.2em}
-div.smalllisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
-pre.smalldisplay {font-family: inherit; font-size: smaller}
-pre.smallexample {font-size: smaller}
-pre.smallformat {font-family: inherit; font-size: smaller}
-pre.smalllisp {font-size: smaller}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
+span:hover a.copiable-anchor {visibility: visible}
ul.no-bullet {list-style: none}
-->
</style>
-<link rel="stylesheet" type="text/css" href="/software/gnulib/manual.css">
+<link rel="stylesheet" type="text/css"
href="https://www.gnu.org/software/gnulib/manual.css">
</head>
<body lang="en">
-<a name="Character-Classes-and-Bracket-Expressions"></a>
+<div class="section" id="Character-Classes-and-Bracket-Expressions">
<div class="header">
<p>
-Next: <a
href="The-Backslash-Character-and-Special-Expressions.html#The-Backslash-Character-and-Special-Expressions"
accesskey="n" rel="next">The Backslash Character and Special Expressions</a>,
Previous: <a href="Fundamental-Structure.html#Fundamental-Structure"
accesskey="p" rel="prev">Fundamental Structure</a>, Up: <a
href="Regular-Expressions.html#Regular-Expressions" accesskey="u"
rel="up">Regular Expressions</a> [<a href="index.html#SEC_Contents"
title="Table of contents" rel="contents">Contents</a>][<a
href="Index.html#Index" title="Index" rel="index">Index</a>]</p>
+Next: <a href="The-Backslash-Character-and-Special-Expressions.html"
accesskey="n" rel="next">The Backslash Character and Special Expressions</a>,
Previous: <a href="Fundamental-Structure.html" accesskey="p"
rel="prev">Fundamental Structure</a>, Up: <a href="Regular-Expressions.html"
accesskey="u" rel="up">Regular Expressions</a> [<a
href="index.html#SEC_Contents" title="Table of contents"
rel="contents">Contents</a>][<a href="Index.html" title="Index"
rel="index">Index</a>]</p>
</div>
<hr>
-<a name="Character-Classes-and-Bracket-Expressions-1"></a>
-<h3 class="section">3.2 Character Classes and Bracket Expressions</h3>
+<span id="Character-Classes-and-Bracket-Expressions-1"></span><h3
class="section">3.2 Character Classes and Bracket Expressions</h3>
-<a name="index-bracket-expression"></a>
-<a name="index-character-class"></a>
+<span id="index-bracket-expression"></span>
+<span id="index-character-class"></span>
<p>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.
@@ -83,7 +76,7 @@
an opening or closing parenthesis, and might or might not match an
encoding error.
</p>
-<a name="index-range-expression"></a>
+<span id="index-range-expression"></span>
<p>Within a bracket expression, a <em>range expression</em> consists of two
characters separated by a hyphen.
It matches any single character that
@@ -104,35 +97,31 @@
for example, ‘<samp>[[:alnum:]]</samp>’ means the character class
of numbers and letters
in the current locale.
</p>
-<a name="index-classes-of-characters"></a>
-<a name="index-character-classes"></a>
+<span id="index-classes-of-characters"></span>
+<span id="index-character-classes"></span>
<dl compact="compact">
-<dt>‘<samp>[:alnum:]</samp>’</dt>
-<dd><a name="index-alnum-character-class"></a>
-<a name="index-alphanumeric-characters"></a>
+<dt
id='index-alnum-character-class'><span>‘<samp>[:alnum:]</samp>’<a
href='#index-alnum-character-class' class='copiable-anchor'>
¶</a></span></dt>
+<dd><span id="index-alphanumeric-characters"></span>
<p>Alphanumeric characters:
‘<samp>[:alpha:]</samp>’ and ‘<samp>[:digit:]</samp>’;
in the ‘<samp>C</samp>’ locale and ASCII
character encoding, this is the same as ‘<samp>[0-9A-Za-z]</samp>’.
</p>
</dd>
-<dt>‘<samp>[:alpha:]</samp>’</dt>
-<dd><a name="index-alpha-character-class"></a>
-<a name="index-alphabetic-characters"></a>
+<dt
id='index-alpha-character-class'><span>‘<samp>[:alpha:]</samp>’<a
href='#index-alpha-character-class' class='copiable-anchor'>
¶</a></span></dt>
+<dd><span id="index-alphabetic-characters"></span>
<p>Alphabetic characters:
‘<samp>[:lower:]</samp>’ and ‘<samp>[:upper:]</samp>’;
in the ‘<samp>C</samp>’ locale and ASCII
character encoding, this is the same as ‘<samp>[A-Za-z]</samp>’.
</p>
</dd>
-<dt>‘<samp>[:blank:]</samp>’</dt>
-<dd><a name="index-blank-character-class"></a>
-<a name="index-blank-characters"></a>
+<dt
id='index-blank-character-class'><span>‘<samp>[:blank:]</samp>’<a
href='#index-blank-character-class' class='copiable-anchor'>
¶</a></span></dt>
+<dd><span id="index-blank-characters"></span>
<p>Blank characters:
space and tab.
</p>
</dd>
-<dt>‘<samp>[:cntrl:]</samp>’</dt>
-<dd><a name="index-cntrl-character-class"></a>
-<a name="index-control-characters"></a>
+<dt
id='index-cntrl-character-class'><span>‘<samp>[:cntrl:]</samp>’<a
href='#index-cntrl-character-class' class='copiable-anchor'>
¶</a></span></dt>
+<dd><span id="index-control-characters"></span>
<p>Control characters.
In ASCII, these characters have octal codes 000
through 037, and 177 (DEL).
@@ -140,64 +129,56 @@
the equivalent characters, if any.
</p>
</dd>
-<dt>‘<samp>[:digit:]</samp>’</dt>
-<dd><a name="index-digit-character-class"></a>
-<a name="index-digit-characters"></a>
-<a name="index-numeric-characters"></a>
+<dt
id='index-digit-character-class'><span>‘<samp>[:digit:]</samp>’<a
href='#index-digit-character-class' class='copiable-anchor'>
¶</a></span></dt>
+<dd><span id="index-digit-characters"></span>
+<span id="index-numeric-characters"></span>
<p>Digits: <code>0 1 2 3 4 5 6 7 8 9</code>.
</p>
</dd>
-<dt>‘<samp>[:graph:]</samp>’</dt>
-<dd><a name="index-graph-character-class"></a>
-<a name="index-graphic-characters"></a>
+<dt
id='index-graph-character-class'><span>‘<samp>[:graph:]</samp>’<a
href='#index-graph-character-class' class='copiable-anchor'>
¶</a></span></dt>
+<dd><span id="index-graphic-characters"></span>
<p>Graphical characters:
‘<samp>[:alnum:]</samp>’ and ‘<samp>[:punct:]</samp>’.
</p>
</dd>
-<dt>‘<samp>[:lower:]</samp>’</dt>
-<dd><a name="index-lower-character-class"></a>
-<a name="index-lower_002dcase-letters"></a>
+<dt
id='index-lower-character-class'><span>‘<samp>[:lower:]</samp>’<a
href='#index-lower-character-class' class='copiable-anchor'>
¶</a></span></dt>
+<dd><span id="index-lower_002dcase-letters"></span>
<p>Lower-case letters; in the ‘<samp>C</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>.
</p>
</dd>
-<dt>‘<samp>[:print:]</samp>’</dt>
-<dd><a name="index-print-character-class"></a>
-<a name="index-printable-characters"></a>
+<dt
id='index-print-character-class'><span>‘<samp>[:print:]</samp>’<a
href='#index-print-character-class' class='copiable-anchor'>
¶</a></span></dt>
+<dd><span id="index-printable-characters"></span>
<p>Printable characters:
‘<samp>[:alnum:]</samp>’, ‘<samp>[:punct:]</samp>’,
and space.
</p>
</dd>
-<dt>‘<samp>[:punct:]</samp>’</dt>
-<dd><a name="index-punct-character-class"></a>
-<a name="index-punctuation-characters"></a>
+<dt
id='index-punct-character-class'><span>‘<samp>[:punct:]</samp>’<a
href='#index-punct-character-class' class='copiable-anchor'>
¶</a></span></dt>
+<dd><span id="index-punctuation-characters"></span>
<p>Punctuation characters; in the ‘<samp>C</samp>’ locale and
ASCII character
encoding, this is
<code>! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` {
| } ~</code>.
</p>
</dd>
-<dt>‘<samp>[:space:]</samp>’</dt>
-<dd><a name="index-space-character-class"></a>
-<a name="index-space-characters"></a>
-<a name="index-whitespace-characters"></a>
+<dt
id='index-space-character-class'><span>‘<samp>[:space:]</samp>’<a
href='#index-space-character-class' class='copiable-anchor'>
¶</a></span></dt>
+<dd><span id="index-space-characters"></span>
+<span id="index-whitespace-characters"></span>
<p>Space characters: in the ‘<samp>C</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.
+See <a href="Usage.html">Usage</a>, for more discussion of matching newlines.
</p>
</dd>
-<dt>‘<samp>[:upper:]</samp>’</dt>
-<dd><a name="index-upper-character-class"></a>
-<a name="index-upper_002dcase-letters"></a>
+<dt
id='index-upper-character-class'><span>‘<samp>[:upper:]</samp>’<a
href='#index-upper-character-class' class='copiable-anchor'>
¶</a></span></dt>
+<dd><span id="index-upper_002dcase-letters"></span>
<p>Upper-case letters: in the ‘<samp>C</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>.
</p>
</dd>
-<dt>‘<samp>[:xdigit:]</samp>’</dt>
-<dd><a name="index-xdigit-character-class"></a>
-<a name="index-xdigit-class"></a>
-<a name="index-hexadecimal-digits"></a>
+<dt
id='index-xdigit-character-class'><span>‘<samp>[:xdigit:]</samp>’<a
href='#index-xdigit-character-class' class='copiable-anchor'>
¶</a></span></dt>
+<dd><span id="index-xdigit-class"></span>
+<span id="index-hexadecimal-digits"></span>
<p>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>
@@ -207,52 +188,52 @@
part of the symbolic names, and must be included in addition to
the brackets delimiting the bracket expression.
</p>
-<a name="invalid_002dbracket_002dexpr"></a><p>If you mistakenly omit the outer
brackets, and search for say, ‘<samp>[:upper:]</samp>’,
+<span id="invalid_002dbracket_002dexpr"></span><p>If you mistakenly omit the
outer brackets, and search for say, ‘<samp>[:upper:]</samp>’,
GNU <code>grep</code> 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>[:epru]</samp>’.
Set the <code>POSIXLY_CORRECT</code> environment variable to disable this
feature.
</p>
-<p>Most meta-characters lose their special meaning inside bracket expressions.
+<p>Special characters lose their special meaning inside bracket expressions.
</p>
<dl compact="compact">
-<dt>‘<samp>]</samp>’</dt>
+<dt><span>‘<samp>]</samp>’</span></dt>
<dd><p>ends the bracket expression 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>
</dd>
-<dt>‘<samp>[.</samp>’</dt>
+<dt><span>‘<samp>[.</samp>’</span></dt>
<dd><p>represents the open collating symbol.
</p>
</dd>
-<dt>‘<samp>.]</samp>’</dt>
+<dt><span>‘<samp>.]</samp>’</span></dt>
<dd><p>represents the close collating symbol.
</p>
</dd>
-<dt>‘<samp>[=</samp>’</dt>
+<dt><span>‘<samp>[=</samp>’</span></dt>
<dd><p>represents the open equivalence class.
</p>
</dd>
-<dt>‘<samp>=]</samp>’</dt>
+<dt><span>‘<samp>=]</samp>’</span></dt>
<dd><p>represents the close equivalence class.
</p>
</dd>
-<dt>‘<samp>[:</samp>’</dt>
+<dt><span>‘<samp>[:</samp>’</span></dt>
<dd><p>represents the open character class symbol, and should be followed by a
valid character class name.
</p>
</dd>
-<dt>‘<samp>:]</samp>’</dt>
+<dt><span>‘<samp>:]</samp>’</span></dt>
<dd><p>represents the close character class symbol.
</p>
</dd>
-<dt>‘<samp>-</samp>’</dt>
+<dt><span>‘<samp>-</samp>’</span></dt>
<dd><p>represents the range if it’s not first or last in a list or the
ending point
of a range.
</p>
</dd>
-<dt>‘<samp>^</samp>’</dt>
+<dt><span>‘<samp>^</samp>’</span></dt>
<dd><p>represents the characters not in the list.
If you want to make the ‘<samp>^</samp>’
character a list item, place it anywhere but first.
@@ -260,10 +241,11 @@
</dd>
</dl>
+</div>
<hr>
<div class="header">
<p>
-Next: <a
href="The-Backslash-Character-and-Special-Expressions.html#The-Backslash-Character-and-Special-Expressions"
accesskey="n" rel="next">The Backslash Character and Special Expressions</a>,
Previous: <a href="Fundamental-Structure.html#Fundamental-Structure"
accesskey="p" rel="prev">Fundamental Structure</a>, Up: <a
href="Regular-Expressions.html#Regular-Expressions" accesskey="u"
rel="up">Regular Expressions</a> [<a href="index.html#SEC_Contents"
title="Table of contents" rel="contents">Contents</a>][<a
href="Index.html#Index" title="Index" rel="index">Index</a>]</p>
+Next: <a href="The-Backslash-Character-and-Special-Expressions.html">The
Backslash Character and Special Expressions</a>, Previous: <a
href="Fundamental-Structure.html">Fundamental Structure</a>, Up: <a
href="Regular-Expressions.html">Regular Expressions</a> [<a
href="index.html#SEC_Contents" title="Table of contents"
rel="contents">Contents</a>][<a href="Index.html" title="Index"
rel="index">Index</a>]</p>
</div>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Changes to grep/manual/html_node/Character-Classes-and-Bracket-Expressions.html, v,
Jim Meyering <=