⚡ L1L`XPL0IT
8.2.34 | Linux | www-data (uid:33)
✏️ Edit: glob.py
📁 //snap/core24/current/usr/lib/python3.12/zipfile/_path/glob.py
import re def translate(pattern): r""" Given a glob pattern, produce a regex that matches it. >>> translate('*.txt') '[^/]*\\.txt' >>> translate('a?txt') 'a.txt' >>> translate('**/*') '.*/[^/]*' """ return ''.join(map(replace, separate(pattern))) def separate(pattern): """ Separate out character sets to avoid translating their contents. >>> [m.group(0) for m in separate('*.txt')] ['*.txt'] >>> [m.group(0) for m in separate('a[?]txt')] ['a', '[?]', 'txt'] """ return re.finditer(r'([^\[]+)|(?P<set>[\[].*?[\]])|([\[][^\]]*$)', pattern) def replace(match): """ Perform the replacements for a match from :func:`separate`. """ return match.group('set') or ( re.escape(match.group(0)) .replace('\\*\\*', r'.*') .replace('\\*', r'[^/]*') .replace('\\?', r'.') )
Cancel
💻 Terminal
📤 Upload
📂
Click or Drag & Drop
📁 //snap/core24/current/usr/lib/python3.12/zipfile/_path
/
/
/
snap
/
core24
/
current
/
usr
/
lib
/
python3.12
/
zipfile
/
_path
Name
Size
Perm
Modified
Actions
📁 __pycache__/
-
0755
2026-08-24 03:28
🗑 Delete
__init__.py
10.5K
0644
2026-06-19 12:46
👁 View
✏️ Edit
📝 Rename
📦 Move
🗑 Del
glob.py
893B
0644
2026-06-19 12:46
👁 View
✏️ Edit
📝 Rename
📦 Move
🗑 Del