[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-gawk] Regex problem with gawk 4.1.2
From: |
Henrik Levkowetz |
Subject: |
[bug-gawk] Regex problem with gawk 4.1.2 |
Date: |
Wed, 13 May 2015 20:38:31 +0200 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 |
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
- [bug-gawk] Regex problem with gawk 4.1.2,
Henrik Levkowetz <=