grep-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Changes to grep/manual/html_node/Matching-Non_002dASCII.html,v


From: Jim Meyering
Subject: Changes to grep/manual/html_node/Matching-Non_002dASCII.html,v
Date: Wed, 22 Mar 2023 22:55:26 -0400 (EDT)

CVSROOT:        /webcvs/grep
Module name:    grep
Changes by:     Jim Meyering <meyering> 23/03/22 22:55:22

Index: html_node/Matching-Non_002dASCII.html
===================================================================
RCS file: /webcvs/grep/grep/manual/html_node/Matching-Non_002dASCII.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- html_node/Matching-Non_002dASCII.html       3 Sep 2022 19:33:14 -0000       
1.3
+++ html_node/Matching-Non_002dASCII.html       23 Mar 2023 02:55:21 -0000      
1.4
@@ -1,11 +1,11 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd";>
+<!DOCTYPE html>
 <html>
-<!-- Created by GNU Texinfo 6.8, https://www.gnu.org/software/texinfo/ -->
+<!-- Created by GNU Texinfo 7.0dev, 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-2022 Free Software Foundation,
+Copyright © 1999-2002, 2005, 2008-2023 Free Software Foundation,
 Inc.
 
 Permission is granted to copy, distribute and/or modify this document
@@ -14,10 +14,10 @@
 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". -->
-<title>Matching Non-ASCII (GNU Grep 3.8)</title>
+<title>Matching Non-ASCII (GNU Grep 3.10)</title>
 
-<meta name="description" content="Matching Non-ASCII (GNU Grep 3.8)">
-<meta name="keywords" content="Matching Non-ASCII (GNU Grep 3.8)">
+<meta name="description" content="Matching Non-ASCII (GNU Grep 3.10)">
+<meta name="keywords" content="Matching Non-ASCII (GNU Grep 3.10)">
 <meta name="resource-type" content="document">
 <meta name="distribution" content="global">
 <meta name="Generator" content="makeinfo">
@@ -30,21 +30,8 @@
 <link href="Character-Encoding.html" rel="prev" title="Character Encoding">
 <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}
-div.display {margin-left: 3.2em}
-div.example {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}
-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}
+a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
+span:hover a.copiable-link {visibility: visible}
 -->
 </style>
 <link rel="stylesheet" type="text/css" 
href="https://www.gnu.org/software/gnulib/manual.css";>
@@ -53,52 +40,52 @@
 </head>
 
 <body lang="en">
-<div class="section" id="Matching-Non_002dASCII">
-<div class="header">
+<div class="section-level-extent" id="Matching-Non_002dASCII">
+<div class="nav-panel">
 <p>
 Previous: <a href="Character-Encoding.html" accesskey="p" rel="prev">Character 
Encoding</a>, Up: <a href="Regular-Expressions.html" accesskey="u" 
rel="up">Regular Expressions</a> &nbsp; [<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>
-<span id="Matching-Non_002dASCII-and-Non_002dprintable-Characters"></span><h3 
class="section">3.9 Matching Non-ASCII and Non-printable Characters</h3>
-<span id="index-non_002dASCII-matching"></span>
-<span id="index-non_002dprintable-matching"></span>
+<h3 class="section" 
id="Matching-Non_002dASCII-and-Non_002dprintable-Characters"><span>3.9 Matching 
Non-ASCII and Non-printable Characters<a class="copiable-link" 
href="#Matching-Non_002dASCII-and-Non_002dprintable-Characters"> 
&para;</a></span></h3>
+<a class="index-entry-id" id="index-non_002dASCII-matching"></a>
+<a class="index-entry-id" id="index-non_002dprintable-matching"></a>
 
 <p>In a regular expression, non-ASCII and non-printable characters other
 than newline are not special, and represent themselves.  For example,
-in a locale using UTF-8 the command &lsquo;<samp>grep 
'Λ&nbsp;ω'</samp>&rsquo; (where the
-white space between &lsquo;<samp>Λ</samp>&rsquo; and the 
&lsquo;<samp>ω</samp>&rsquo; is a tab character)
-searches for &lsquo;<samp>Λ</samp>&rsquo; (Unicode character U+039B GREEK 
CAPITAL LETTER
-LAMBDA), followed by a tab (U+0009 TAB), followed by 
&lsquo;<samp>ω</samp>&rsquo; (U+03C9
+in a locale using UTF-8 the command &lsquo;<samp class="samp">grep 
'Λ&nbsp;ω'</samp>&rsquo; (where the
+white space between &lsquo;<samp class="samp">Λ</samp>&rsquo; and the 
&lsquo;<samp class="samp">ω</samp>&rsquo; is a tab character)
+searches for &lsquo;<samp class="samp">Λ</samp>&rsquo; (Unicode character 
U+039B GREEK CAPITAL LETTER
+LAMBDA), followed by a tab (U+0009 TAB), followed by &lsquo;<samp 
class="samp">ω</samp>&rsquo; (U+03C9
 GREEK SMALL LETTER OMEGA).
 </p>
 <p>Suppose you want to limit your pattern to only printable characters
 (or even only printable ASCII characters) to keep your script readable
 or portable, but you also want to match specific non-ASCII or non-null
-non-printable characters.  If you are using the <samp>-P</samp>
-(<samp>--perl-regexp</samp>) option, PCREs give you several ways to do
+non-printable characters.  If you are using the <samp class="option">-P</samp>
+(<samp class="option">--perl-regexp</samp>) option, PCREs give you several 
ways to do
 this.  Otherwise, if you are using Bash, the GNU project&rsquo;s shell, you
 can represent these characters via ANSI-C quoting.  For example, the
-Bash commands &lsquo;<samp>grep $'Λ\tω'</samp>&rsquo; and &lsquo;<samp>grep 
$'\u039B\t\u03C9'</samp>&rsquo;
-both search for the same three-character string 
&lsquo;<samp>Λ&nbsp;ω</samp>&rsquo;
+Bash commands &lsquo;<samp class="samp">grep $'Λ\tω'</samp>&rsquo; and 
&lsquo;<samp class="samp">grep $'\u039B\t\u03C9'</samp>&rsquo;
+both search for the same three-character string &lsquo;<samp 
class="samp">Λ&nbsp;ω</samp>&rsquo;
 mentioned earlier.  However, because Bash translates ANSI-C quoting
-before <code>grep</code> sees the pattern, this technique should not be
-used to match printable ASCII characters; for example, &lsquo;<samp>grep
-$'\u005E'</samp>&rsquo; is equivalent to &lsquo;<samp>grep '^'</samp>&rsquo; 
and matches any line, not
-just lines containing the character &lsquo;<samp>^</samp>&rsquo; (U+005E 
CIRCUMFLEX
+before <code class="command">grep</code> sees the pattern, this technique 
should not be
+used to match printable ASCII characters; for example, &lsquo;<samp 
class="samp">grep
+$'\u005E'</samp>&rsquo; is equivalent to &lsquo;<samp class="samp">grep 
'^'</samp>&rsquo; and matches any line, not
+just lines containing the character &lsquo;<samp class="samp">^</samp>&rsquo; 
(U+005E CIRCUMFLEX
 ACCENT).
 </p>
 <p>Since PCREs and ANSI-C quoting are GNU extensions to POSIX, portable
 shell scripts written in ASCII should use other methods to match
 specific non-ASCII characters.  For example, in a UTF-8 locale the
-command &lsquo;<samp>grep &quot;$(printf 
'\316\233\t\317\211\n')&quot;</samp>&rsquo; is a portable
-albeit hard-to-read alternative to Bash&rsquo;s &lsquo;<samp>grep 
$'Λ\tω'</samp>&rsquo;.
+command &lsquo;<samp class="samp">grep &quot;$(printf 
'\316\233\t\317\211\n')&quot;</samp>&rsquo; is a portable
+albeit hard-to-read alternative to Bash&rsquo;s &lsquo;<samp class="samp">grep 
$'Λ\tω'</samp>&rsquo;.
 However, none of these techniques will let you put a null character
 directly into a command-line pattern; null characters can appear only
-in a pattern specified via the <samp>-f</samp> (<samp>--file</samp>) option.
+in a pattern specified via the <samp class="option">-f</samp> (<samp 
class="option">--file</samp>) option.
 </p>
 </div>
 <hr>
-<div class="header">
+<div class="nav-panel">
 <p>
 Previous: <a href="Character-Encoding.html">Character Encoding</a>, Up: <a 
href="Regular-Expressions.html">Regular Expressions</a> &nbsp; [<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>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]