{"id":23800,"library":"globre","title":"globre","description":"A glob matching library providing an interface similar to the `re` module. Version 0.1.5 is latest. The library appears to be in maintenance mode with infrequent releases.","status":"maintenance","version":"0.1.5","language":"python","source_language":"en","source_url":"http://github.com/metagriffin/globre","tags":["glob","pattern-matching","globre"],"install":[{"cmd":"pip install globre","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"globre is a top-level module, not a submodule.","wrong":"from globre import globre","symbol":"globre","correct":"import globre"}],"quickstart":{"code":"import globre\n# Match a glob pattern\nif globre.match('*.py', 'test.py'):\n    print('matches')","lang":"python","description":"Basic usage: import globre and use match() like re.match()."},"warnings":[{"fix":"Use globre.search() for partial matches, globre.match() for anchored start.","message":"Common mistake: treat globre.match() like Python's fnmatch. globre.match() behaves like re.match (anchored at start) but with glob syntax. To match anywhere use globre.search().","severity":"gotcha","affected_versions":"all"},{"fix":"Remember: it's glob syntax, not regex. Use bracket patterns like [abc] for character sets, * for any string, ? for single char.","message":"Pattern syntax: globre uses standard glob patterns (like **, *, ?, [...]) not regex. Escaping special regex characters is not needed, but glob special characters must be escaped. This confusion often leads to errors.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use globre.match(pattern, string) directly; no compile step needed.","cause":"globre does not implement a compile() function; it provides match, search, etc. directly.","error":"AttributeError: module 'globre' has no attribute 'compile'"},{"fix":"Always pass patterns as strings: globre.match('**/*.py', 'src/mod.py')","cause":"User mistakenly used '**' in a context where Python interprets it as exponentiation (e.g., inside an f-string or without quotes).","error":"SyntaxError: invalid syntax (when using '**' in pattern)"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}