[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-gawk] How to extract the matches with {n,m} in regex?
From: |
Peng Yu |
Subject: |
[bug-gawk] How to extract the matches with {n,m} in regex? |
Date: |
Sat, 15 Dec 2018 12:13:11 -0600 |
Hi,
I only see "B" is returned but not "A". Is it possible to return it? Thanks.
$ awk -e 'BEGIN { s=" A B"; match(s, /( +([A-Z]+)){1,2}$/, a); for(k
in a) print k, a[k]; }'
0start 1
0length 4
1start 3
2start 4
2length 1
1length 2
0 A B
1 B
2 B
--
Regards,
Peng
- [bug-gawk] How to extract the matches with {n,m} in regex?,
Peng Yu <=