Lesson 140: Structured text with regular expressions
Focus
Slow tempo wins; narrate checkpoints aloud: Intermediate drills Structured text with regular expressions; spin token 1165769 makes this page unlike its neighbours.
Key ideas
- Angle
Intermediate: micro cadence10mixesStructured text with regular expressions; spin41575. - Ritual: Annotate every meaningful print before deleting noise.
- Guardrail: promise one security boundary if this touched user data.
Example (LESSON_UID = "intermediate-140")
# Intermediate drill L140 topic-13 micro-9 pattern-7
LESSON_UID = "intermediate-140"
spin_a, spin_b, spin_c = 138, 296, 834
src = [((k + 140) * spin_a + 9) % 241 for k in range(4 + 9 % 3)]
derived = [v * v if v % 2 == 0 else v + spin_b for v in src]
print("src", src)
print("derived", derived)
print("zip_sum", sum(x + y for x, y in zip(src, derived)))
from pathlib import Path
import tempfile
with tempfile.TemporaryDirectory() as scratch:
target = Path(scratch) / "scratch-140.txt"
snap = [153, 304, 455, 606]
target.write_text("\n".join(str(x) for x in snap), encoding="utf-8")
print("scratch_bytes", target.stat().st_size, "rolling", sum(snap) % (834 + 131))
Practice
Practice 44: Export checkpoints into bullets for teammate review. Literal nudge 44.
Fingerprints
- lesson_uid:
intermediate-140 - umbrella band:
Structured text with regular expressions(10/10) - lesson_index:
4512