modified: install/chmod.sh
modified: install/openwrt.sh modified: install/pacman.sh modified: install/tree_cpy.sh modified: usr/bin/aur modified: usr/bin/brc new file: usr/bin/idea modified: usr/bin/mountcrypt new file: usr/bin/regex_gen modified: usr/etc/pam.d/system-local-login modified: usr/etc/resolv.conf modified: usr/etc/systemd/resolved.conf modified: usr/etc/systemd/system/tcpd.service modified: usr/home/.bash_aliases modified: usr/home/.bashrc
This commit is contained in:
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env python3
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
# Ensure exrex is installed
|
||||
try:
|
||||
import exrex
|
||||
except ImportError:
|
||||
subprocess.check_call([sys.executable, "-m", "pip", "install", "exrex"])
|
||||
import exrex
|
||||
|
||||
import argparse
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description="Generate all possibilities from a regex")
|
||||
parser.add_argument("regex", type=str, help="Regex pattern (finite)")
|
||||
args = parser.parse_args()
|
||||
|
||||
try:
|
||||
for match in exrex.generate(args.regex):
|
||||
print(match)
|
||||
except Exception as e:
|
||||
print(f"Error: {e}", file=sys.stderr)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user