Skip to content

Instantly share code, notes, and snippets.

@jedimasterbot
jedimasterbot / strings.py
Last active May 30, 2022 01:36 — forked from williballenthin/strings.py
Extract ASCII and Unicode strings using Python.
import re
from collections import namedtuple
ASCII_BYTE = rb" !\"#\$%&\'\(\)\*\+,-\./0123456789:;<=>\?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\[\]\^_`abcdefghijklmnopqrstuvwxyz\{\|\}\\\~\t"
String = namedtuple("String", ["s", "offset"])