Skip to content

Instantly share code, notes, and snippets.

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