gawk regex range operator not working

Bug #1647879 reported by Andrej Ricnik
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gawk (Ubuntu)
New
Undecided
Unassigned

Bug Description

cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04.5 LTS"

awk --version
GNU Awk 3.1.8
Copyright (C) 1989, 1991-2010 Free Software Foundation.

apt-cache policy gawk
gawk:
  Installed: 1:3.1.8+dfsg-0.1ubuntu1

Test-case:

echo "/tmp/tmp.Ofefwsef23" | awk '/\/tmp\/tmp\.[[:alnum:]]{10}/'
<no output>
echo "/tmp/tmp.Ofefwsef23" | awk '/\/tmp\/tmp\.[[:alnum:]]+/'
/tmp/tmp.Ofefwsef23

Same thing on 14.04, gawk 4.1.1, this is what I expect for 3.1.8 as well:
echo "/tmp/tmp.Ofefwsef23" | awk '/\/tmp\/tmp\.[[:alnum:]]{10}/'
/tmp/tmp.Ofefwsef23

According to the man page for the older gawk this is supposed to work
   Regular Expressions
       Regular expressions are the extended kind found in egrep. They are composed of characters as follows:

       c matches the non-metacharacter c.

       \c matches the literal character c.

       . matches any character including newline.

       ^ matches the beginning of a string.

       $ matches the end of a string.

       [abc...] character list, matches any of the characters abc....

       [^abc...] negated character list, matches any character except abc....

       r1|r2 alternation: matches either r1 or r2.

       r1r2 concatenation: matches r1, and then r2.

       r+ matches one or more r's.

       r* matches zero or more r's.

       r? matches zero or one r's.

       (r) grouping: matches r.

       r{n}
       r{n,}
       r{n,m} One or two numbers inside braces denote an interval expression. If there is one number in the
                  braces, the preceding regular expression r is repeated n times. If there are two numbers separated
                  by a comma, r is repeated n to m times. If there is one number followed by a comma, then r is
                  repeated at least n times.
                  Interval expressions are only available if either --posix or --re-interval is specified on the com‐
                  mand line.

       \y matches the empty string at either the beginning or the end of a word.

       \B matches the empty string within a word.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/1647879/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
Andrej Ricnik (a-ricnik)
affects: ubuntu → gawk (Ubuntu)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.