Skip to content

Exact matching of a whitespace followed by double quote and text gets broken into parts #810

@gpgekko

Description

@gpgekko

Is there an existing issue for this?

  • I have searched the existing issues

Description of the bug

It seems I have run into an edge case with the exact matching. The SPACE_RE regex does not handle an edge case that from time to time occurs in my usage.

I managed to narrow it down to a string where a text is followed by a whitespace, followed by a double quote and then text. This gets erroneously split into two query parts on the whitespace, even though it was meant to be a single exact match query. I've set up a few tests at https://regex101.com/r/jlilH6/5 to try and wrap my head around it.

The Fuse.js version where this bug is happening.

6.6.2

Is this a regression?

  • This is a regression bug

Which version did this behavior use to work in?

None

Steps To Reproduce

  1. Run a search with the string ="said "test"
  2. Set a breakpoint in the parseQuery(pattern) method
  3. Observe item: "=\"said \"test\"" and query: ['="said', '"test"']

Expected behavior

I expected it to keep the exact match intact, and therefor to see at step 3 query: ['="said "test"']

Screenshots

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions