bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] gawk handling of "." in regular expressions


From: arnold
Subject: Re: [bug-gawk] gawk handling of "." in regular expressions
Date: Fri, 28 Dec 2018 00:58:13 -0700
User-agent: Heirloom mailx 12.5 7/5/10

OK, glad you figured it out. :-)

Arnold

"Liddell, Dan" <address@hidden> wrote:

> Please ignore. I see the error of my ways. Thanks.
> dan
>
> From: Liddell, Dan
> Sent: Thursday, December 27, 2018 5:20 PM
> To: 'address@hidden' <address@hidden>
> Subject: gawk handling of "." in regular expressions
>
> Hi,
>
> In the current gawk documentation:
>
> https://www.gnu.org/software/gawk/manual/html_node/Regexp-Operators.html#Regexp-Operators
>
> This is stated under the period (.) operator section:
>
>                 "This matches any single character, including the newline 
> character."
>
> I'm wondering about the newline character claim.
>
> Here is an example from Linux.
>
> $ awk --version
> GNU Awk 4.2.1, API: 2.0 (GNU MPFR 4.0.1-p11, GNU MP 6.1.2)
> $ cat test
> foo
> bar
> # the only character between foo and bar is a newline
> # as demonstrated here:
> $ xxd -p test
> 666f6f0a6261720a
> # here, 0a is the hex form for newline.
> # now test whether "." can match a newline.
> $ cat test | awk '/foo.bar/'
>
> # no output.
>
> It seems a newline is not matched by ".", contrary to the documentation.
>
> Bug or misunderstanding?
>
> Thanks,
> dan
>



reply via email to

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