Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FS regex [^,]* fails on empty field #190

Closed
benhoyt opened this issue Jun 13, 2023 · 0 comments · Fixed by #214
Closed

FS regex [^,]* fails on empty field #190

benhoyt opened this issue Jun 13, 2023 · 0 comments · Fixed by #214

Comments

@benhoyt
Copy link
Owner

benhoyt commented Jun 13, 2023

For example:

$ echo 'x,,z' | goawk -F'[^,]*' '{for (i=1;i<=NF;i++) print i, "<"$i">"}'
1 <>
2 <,>
3 <,>
4 <>

# Should be (and other AWKs print):
$ echo 'x,,z' | gawk -F'[^,]*' '{for (i=1;i<=NF;i++) print i, "<"$i">"}'
1 <>
2 <,,>
3 <>

See https://www.austingroupbugs.net/view.php?id=1468 (0001468).

Thanks @raygard for the report.

fioriandrea added a commit to fioriandrea/goawk that referenced this issue Oct 9, 2023
A custom split function has been introduced. This split function skips
empty matches. It is used only for FS
fioriandrea added a commit to fioriandrea/goawk that referenced this issue Oct 10, 2023
benhoyt pushed a commit that referenced this issue Oct 16, 2023
A custom split function has been introduced. This split function skips
empty matches. It is used only for FS.

See #190 for details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant