[Bug 1647879] Re: gawk regex range operator not working

Andrej Ricnik a.ricnik at gmail.com
Wed Dec 7 00:46:12 UTC 2016


** Package changed: ubuntu => gawk (Ubuntu)

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

Title:
  gawk regex range operator not working

Status in gawk package in Ubuntu:
  New

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.

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



More information about the foundations-bugs mailing list