php / php/php-src

Brace expansions for fnmatch()

Open
#9,223 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature Status: Needs Triage
Dominant language
C
Stars
40.4k
Forks
8.1k
Avg merge
2d 13h
Merged PRs (30d)
96

Description

Description

I would like to bring up a discussion of having fnmatch() supporting brace expansions like GLOB_BRACE does glob(). I couldn't see that the topic has been brought up before.

I came across this missing feature a couple of times now having to create an annoying regex workaround.

Python added this a couple of years ago.
https://github.com/python/cpython/pull/6299

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

Start by locating PHP's fnmatch() and glob() implementations and comparing their existing pattern behavior, then review the linked Python change for brace-expansion semantics. Define how fnmatch() should handle the same brace forms as GLOB_BRACE and verify the behavior with focused coverage before considering the feature complete.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, php
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.