Skip to content

String match with capturing group #6056

@m0nhawk

Description

@m0nhawk

fish seems to broke the behavior of string match.

I'm trying to match the part of filename after _ and before .:

➜ string match -r "_([^_]*)\." "very_nice_file_whatmatter.csv"
_whatmatter.
whatmatter
➜ string match -r "_[^_]*\." "very_nice_file_whatmatter.csv"
_whatmatter.

I found this issue #4925, but the behavior there is different than what I got.

Not sure if it's the bug or a feature I'm missing.

fish, version 3.0.2

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions