Public bug reported:

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.

** Affects: ubuntu
     Importance: Undecided
         Status: New


** Tags: gawk range regex

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1647879

Title:
  gawk regex range operator not working

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+bug/1647879/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to