-------- Original Message --------
Subject: Re: [bug-gawk] BUG: Gawk interval _expression_ metacharacter {} is not working as expected
Local Time: November 19, 2017 1:03 AM
UTC Time: November 18, 2017 7:33 PM
From: address@hidden
To: address@hidden, address@hidden
address@hidden
Davide's answer is right. Thanks Davide.
If you don't understand why, let me know.
Arnold
On Sat, 18 Nov 2017 12:13:04 -0500, "Quantum.Saturn"
Hi,
I have reported the following bug with Ubuntu distribution.
This needs to go upstream, so I reporting it here.
BUG DESCRIPTION:
The interval _expression_ metacharacter {} is not working as expected. The
problem specifically being when the interval is defined on the first
character of the string/record. Otherwise if the interval is defined on
any other character apart from the first in the string then its working
as expected.
INPUT FILE DATA: metacharfile
jas
jjas
jjjas
jjjjas
jjjjjas
COMMAND:
gawk '/j{1,3}as/' ./metacharfile
EXPECTED RESULT:
jas
jjas
jjjas
ACTUAL RESULT:
jas
jjas
jjjas
jjjjas
jjjjjas
You forgot to anchor the _expression_ to the beginning of the string to match.
Try with
gawk '/^j{1,3}as/' ./metacharfile