Skip to content

tac: -r regex flavor incompatibility #10320

@sylvestre

Description

@sylvestre

Component

tac

Description

Regex::new(separator) is not compatible with \|, example here https://www.gnu.org/software/coreutils/manual/html_node/tac-invocation.html

    let maybe_pattern = if regex {
        match regex::bytes::Regex::new(separator) {
            Ok(p) => Some(p),
            Err(e) => return Err(TacError::InvalidRegex(e).into()),
        }
    } else {
        None
    };

Test / Reproduction Steps

core_sbx$ echo abc > t
core_sbx$ tac -r -s 'x\|[^x]' t

cbacore_sbx$ ../target/release/tac -r -s 'x\|[^x]' t
abc

Impact

Scripts relying on GNU coreutils documentation and examples will get incorrect output without error.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions