You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While cut doesn't support it, I don't see why multichar delimiters should not be allowed; yes it's available with regex (but needs escaping sometimes) but why have the restriction in the first place?
It doesn't even really matter for cut compat, given that as cut doesn't support them, all it would do is not error for cut-invalid values — presumably not something a script would rely on
The text was updated successfully, but these errors were encountered:
passcod
changed the title
Why restrict on single character delimiter (!
Why restrict on single character delimiter (in non regex mode)
Jul 7, 2021
You can! I'll add a section in the README about it.
# with string literal
❯ printf'this$;$is$;$a$;$test\na$;$b$;$3$;$four\n'> test.txt
❯ hck -Ld'$;$' -f3,4 ./test.txt
a test
3 four
# with an interesting regex
❯ printf'this123__is456--a789-test\na129_-b849-_3109_-four\n'> test.txt
❯ hck -d'\d{3}[-_]+' -f3,4 ./test.txt
a test
3 four
Theoretically this worked in v0.2.0, but I kind of borked a whole codepath (as you discovered, sorry!), so it probably looked like it wasn't supported.
(apologies for edit, fat thumbs)
While cut doesn't support it, I don't see why multichar delimiters should not be allowed; yes it's available with regex (but needs escaping sometimes) but why have the restriction in the first place?
It doesn't even really matter for cut compat, given that as cut doesn't support them, all it would do is not error for cut-invalid values — presumably not something a script would rely on
The text was updated successfully, but these errors were encountered: