Skip to content

string match broken with multiline input #7938

Description

@lelgenio

My information

~> fish --version
fish, versão 3.2.1
~> echo $version
3.2.1
~> uname -a
Linux artix-i15 5.11.13-zen1-1-zen #1 ZEN SMP PREEMPT Sun, 11 Apr 2021 10:10:31 +0000 x86_64 GNU/Linux

How to reproduce

~> sh -c 'env HOME=$(mktemp -d) fish'
~> echo "100 101" | string match -ra '(?<nums>\d+)'
100
100
101
101
~> echo $nums # Ok
100 101
~> echo "100 101" | string match -qra '(?<nums>\d+)'
~> echo $nums # Ok
100 101
~> seq 100 101 | string match -ra '(?<nums>\d+)'
100
100
101
101
~> echo $nums # No output?

~> seq 100 101 | string match -qra '(?<nums>\d+)'
~> echo $nums # Only matches first?
100

I expected all of them to have the same result.

I bet there's no problem at all and i'm just missing something 🙄

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions