bug-gawk
[Top][All Lists]
Advanced

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

[bug-gawk] awk V4 patsplit: many unexpected 0 length elements in output


From: David Kra
Subject: [bug-gawk] awk V4 patsplit: many unexpected 0 length elements in output array
Date: Mon, 17 Feb 2014 08:06:54 -0500

Based on the documentation, I would not expect that there would be null elements in the array produced by patsplit, as long as the pattern requires at least one character, in my case 7.

# BUG: patsplit(string, array, pattern, seps) produces many unexpected 0 length elements in array

# DEMONSTRATION PROGRAM: Output a CSV with the input line and the array's elements for any line where there are array elements that are less than the length required by pattern. (These miss hits happen to all be 0 length)

# DEMONSTRATION INPUT DATA: the program itself. Input lines of interest are the comment lines at the bottom.

Alert: I am not a regexpert. It could be that my regex does match the null string, though I can't see how. It is a long assembly of several shorter regex's, each wrapped in () and then all  ||'d together, as in: "(p1)||(p2)||(p3)||(p4)||(p5)"

"([ABDE][0-9][0-9A-Z]{4}[A-Z])||([ABDE][0-9A-Z]{1}[0-9][0-9A-Z]{3}[A-Z])||([ABDE][0-9A-Z]{2}[0-9][0-9A-Z]{2}[A-Z])||([ABDE][0-9A-Z]{3}[0-9][0-9A-Z]{1}[A-Z])||([ABDE][0-9A-Z]{4}[0-9][A-Z])"

The goal is to match 7 character strings that start with one of a few letters, ends in a letter, has alphanumerics in the middle, but must have at least one digit in the middle.

--
Thank you
for all your efforts.

David
--
((8-)> David A. Kra                      mailto:address@hidden            
Google Voice & SMS: 860 325 2267  http://www.linkedin.com/in/dakra
 

“Make everything as simple as possible, but not simpler.” Albert Einstein.

“Never put anything unnecessary on the critical path.” Ellen Schaeffer

“People will just step in it or at least trip over it.” Anonymous
__________________________________________________________________

Attachment: patsplitbug.awk
Description: Binary data


reply via email to

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