posixutils-rs icon indicating copy to clipboard operation
posixutils-rs copied to clipboard

tr: add full support for ranges

Open andrewliebenow opened this issue 1 year ago • 0 comments

tr currently only handles ranges if they are the only construct in the string containing them (see contains_single_range).

Add proper handling of ranges: multiple in one string, ranges from one character type to another (e.g. tr -d '\060-9 A-Z').

Fix handling of octal sequences above \377.

Add validation to ensure equiv (in "[=equiv=]" constructs) is only one character.

Add validation to ensure ranges are not "backwards" (the ending character be must greater than or equal to the starting character).

Parse and validate string1 and string2 before reading from stdin.

andrewliebenow avatar Oct 12 '24 04:10 andrewliebenow