Metadata-Version: 2.5
Name: rulecc
Version: 0.0.3
Summary: Shell-style wildcard matching with ** for path segments.
Project-URL: Homepage, https://github.com/lqxnjk/rulecc
Author: lqxnjk
License: MIT
License-File: LICENSE
Keywords: glob,match,path,pattern,wildcard
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# rulecc

Shell-style wildcards for arbitrary strings — including `**`, which `fnmatch`
does not treat specially.

## Install

```console
pip install rulecc
```

## Usage

```python
from rulecc import wildcard_match

wildcard_match("*.py", "app.py")          # True
wildcard_match("*.py", "pkg/app.py")      # False  * does not cross /
wildcard_match("**/*.py", "pkg/app.py")   # True
wildcard_match("**/*.py", "app.py")       # True   **/ may match nothing
wildcard_match("a?c", "abc")              # True
wildcard_match("[abc]x", "bx")            # True
wildcard_match("[!abc]x", "bx")           # False
```

## Differences from `fnmatch`

| Pattern | `fnmatch` | rulecc |
| --- | --- | --- |
| `*` | crosses `/` | does **not** cross `/` |
| `**` | same as `*` | crosses `/` |
| `**/x` | — | matches `x` and `a/b/x` |

That makes patterns usable for paths without surprises.

To reuse a pattern, call `compile_wildcard` once and `.match()` the result.

## License

MIT
