Skip to content

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

Closed

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

Activity

  1. github-actions commented on Mar 20, 2026

    @github-actions

    This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 30 days

  2. krisk commented on Apr 2, 2026

    @krisk
    Owner

    Fixed in c226523. The SPACE_RE regex has been replaced with a proper tokenizer that correctly handles multi-match quoted tokens containing inner spaces and quotes.

    ="said "test" now correctly tokenizes as a single exact-match for said "test instead of being split into two tokens.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions