On Thu, May 28, 2015 at 02:08:47AM -0500, [email protected] wrote:
> Hi misc,
>
> I'm running a 5.7 release, and I'm wondering if anyone can confirm
> an awk bug I found.
>
> Curly brackets are treated as literal characters instead of bounds
> as specified by re_format(7).
>
> Reproduction:
>
> echo aa | awk '/a{2}/'
>
> produces no output instead of printing "aa" as expected.
>
> echo 'a{2}' | awk '/a{2}/'
>
> produces output when none is expected.
>
> This bug seems awk specific since the equivalents using grep
>
> echo aa | grep -E 'a{2}'
>
> echo 'a{2}' | grep -E 'a{2}'
>
> work as expected.
Tradiotionally, { } pattersn are not part of awk re's.
Posix added them, but we do not include them afaik. Gnu awk only accepts
them if given an extra arg (--posix or --re-interval).
I think this should be documented.
-Otto