Skip to content

Issues with matching \s #115

Closed
Closed
@smac89

Description

It seems very buggy atm. Strangely enough, using [ ] does not show the same behavior.

For example, given the following text:

# Here we go
This is a line

# Let's try this again
Here is another line

# Third time's the charm
Am I a line?

I will now run the following commands using the above text as input and a mix of [ ] and \s:

In all of the following instances, grep is aliased to ugrep --sort --basic-regexp --binary --empty --hidden

➜ clippaste | grep '\s*#'        
# Here we go
This is a line

# Let's try this again
Here is another line

# Third time's the charm

Clearly wrong output

➜ clippaste | grep '[ ]*#'
# Here we go
# Let's try this again
# Third time's the charm

Much better!

➜ clippaste | grep -v '\s*#'
Am I a line?

Nope!

➜ clippaste | grep -v '[ ]*#'
This is a line

Here is another line

Am I a line?

Yes!


I hope that's enough to track down this bug.

ugrep version:

ugrep 3.1.10 x86_64-pc-linux-gnu +avx2 +pcre2_jit +zlib +bzip2 +lzma +lz4
License BSD-3-Clause: <https://opensource.org/licenses/BSD-3-Clause>
Written by Robert van Engelen and others: <https://github.com/Genivia/ugrep>

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestquestionA question that has or needs further clarification

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions