bug-gawk
[Top][All Lists]
Advanced

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

Re: Does gawk manual mention how an empty regex should be handled?


From: arnold
Subject: Re: Does gawk manual mention how an empty regex should be handled?
Date: Wed, 31 Mar 2021 12:21:34 -0600
User-agent: Heirloom mailx 12.5 7/5/10

I have updated the documentation and pushed to the git repo.

Thanks,

Arnold

Arkadiusz Drabczyk <arkadiusz@drabczyk.org> wrote:

> TIL that empty regex matches any string:
>
> $ awk 'BEGIN { print "abc" ~ "" }'
> 1
> $ awk 'BEGIN { print "abc" ~ // }'
> 1
>
> It can also be reproduced with mawk, Busybox awk and FreeBSD
> awk. However, I wasn't able to find an explanation of that behavior in
> the gawk manual. Is it actually documented somewhere?
>
> -- 
> Arkadiusz Drabczyk <arkadiusz@drabczyk.org>



reply via email to

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