[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gawk] Regex problem with gawk 4.1.2
From: |
Henrik Levkowetz |
Subject: |
Re: [bug-gawk] Regex problem with gawk 4.1.2 |
Date: |
Thu, 14 May 2015 22:45:23 +0200 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 |
Hi Arnold, Andy,
On 2015-05-14 13:09, Aharon Robbins wrote:
> Hi. Thanks for the report.
You're welcome. Thanks for your work on gawk!
> As Andy answered, there is a bug in this area. If you change your code to
>
> if (ref ~ /[[,]/) { print "whoo"; }
>
> you should be OK. I plan to release 4.1.3 fairly soon, since this is
> a fairly critical bug.
Ack. There's actually a bunch of similar regexes in my code, so I'd have to
fix all of them in that case; fortunately it's also feasible for me to advise
my users to go with another version of gawk than 4.1.2; one user who ran into
this downgraded to 4.1.1. and things were fine.
Thanks again to both of you for your work and for your replies :-)
Best regards,
Henrik
> Thanks!
>
> Arnold
>
>> Hi,
>>
>> One of my venerable awk programs, which I've tried to keep compatible with
>> awk,
>> nawk, and gawk for close to 15 years, suddenly broke when run with gawk
>> 4.1.2.
>>
>> I've reduced the problem to the following little snippet. The problem seems
>> to be with inclusion of an unquoted '[' character within the regex bracket
>> expression, but not as the first character. According to the manual this
>> should
>> work [1], and it has indeed worked for me as long as I've worked with awk,
>> but
>> doesn't do so any more in 4.1.2:
>>
>> #!/opt/local/bin/gawk -f
>> BEGIN {
>> ref = ",";
>> if (ref ~ /[,[]/) { print "whoo"; }
>> }
>>
>> My copy of gawk 4.1.2 is running on OS X, version 10.9.5, installed with
>> macports,
>> and gives its version number as "GNU Awk 4.1.2, API: 1.1"
>>
>>
>> Best regards,
>>
>> Henrik
>>
>> [1]
>> http://www.gnu.org/software/gawk/manual/html_node/Bracket-Expressions.html
>
signature.asc
Description: OpenPGP digital signature