Log inBook a Demo
BuildMidBackendAuto-graded

Fix a glob matcher that flags wrong files

Bring a path matcher in line with its spec for *, ?, [a-z] classes and **, so CI picks the right files.A build tool uses match(pattern, name) in matcher.py to decide which paths CI acts on, and it gets many of them wrong. Make it follow SPEC.md: *, ? and character classes (ranges and [!...] negation) stay inside one path segment, and only ** crosses /, spanning zero or more whole segments. Write the matcher yourself; fnmatch, glob and pathlib globbing are off limits.
40 min
python

You're done when

  • * matches any run of characters inside one segment, including none, and never matches a /.
  • ? matches exactly one character, never a /.
  • Character classes work, with ranges and [!...] negation.
  • ** matches zero, one or many whole path segments, as SPEC.md describes.

What it measures

Data structures and algorithmsMatching `*` and `**` with backtracking that tries every split the rest of the pattern might need.
Test case designTesting the cases the spec spells out, beyond the smoke tests in `test_matcher.py`.
Working to a specificationFollowing `SPEC.md` exactly, including the rule that only `**` can match a `/`.

Your environment

Terminal + editorA full shell in the browser
Claude CodePre-authenticated, no key setup
Isolated microVMYours alone, wiped afterwards

Start this lab

40 min
Start labYou'll sign in to Anthropos to start. The lab opens in a private cloud workspace with Claude Code ready to use.
AI Labs is part of Anthropos Workforce. Not on your plan yet? Book a demo