micromatch / micromatch/picomatch

Inconsistent Matching Behavior Between `(feature/**|feature*)` and `(feature*|feature/**)` for `feature/test/test`

Open
#147 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.3k
Forks
135
Avg merge
23h 38m
Merged PRs (30d)
7

Description

Issue Description:

The regular expressions (feature/**|feature*) and (feature*|feature/**) yield inconsistent results when matching the string feature/test/test. Specifically:

  1. (feature/**|feature*) does not match feature/test/test.
  2. (feature*|feature/**) does match feature/test/test.

This behavior seems unexpected, as both expressions appear to be logically similar. Could you please clarify why this inconsistency occurs and provide guidance on the correct usage of these patterns?

Steps to Reproduce:

  1. Use the regular expression (feature/**|feature*) to match the string feature/test/test.
  2. Use the regular expression (feature*|feature/**) to match the same string.

Expected Result:
Both expressions should either match or not match the string consistently.

Actual Result:
The first expression does not match, while the second one does.

Additional Context:
This issue might be related to the order of patterns in the alternation (|) or the interpretation of the * and /** operators. Any insights or documentation on this behavior would be greatly appreciated.

Thank you!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or entry points. Start by reproducing both patterns against feature/test/test using the project's public matching interface, then identify where pattern-order and glob-operator behavior is documented. Done means explaining the differing results and documenting the correct usage or expected semantics.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.