bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gawk] BUG: Gawk interval expression metacharacter {} is not wor


From: Quantum.Saturn
Subject: Re: [bug-gawk] BUG: Gawk interval expression metacharacter {} is not working as expected
Date: Sun, 19 Nov 2017 05:49:08 -0500

Hi David, Arnold,

Thanks for your replies and help. After rethinking of how the pattern matching
will work for 'beginning of the string mismatch cases'  (i.e. 'jjjjas' and 'jjjjjas'),
I finally got it and its NOT a bug. Thanks for showing the usage of anchor in
this scenario.

I will also reject this non-issue on ubuntu distribution.

Thanks & Regards,
Sanjeev Ranot



Sent with ProtonMail Secure Email.

-------- 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

Davide Brini address@hidden wrote:
On Sat, 18 Nov 2017 12:13:04 -0500, "Quantum.Saturn"
address@hidden wrote:
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

--
D.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]