Skip to content

regex

a pattern for matching text

1
# regex: a pattern, r and then quotes
2
r"\d+"
Example outputCtrl+Enter to run
1
# a regex works where a function takes a pattern
2
"a1b22".find_all(r"\d+")["1", "22"]
Example outputCtrl+Enter to run

Example results generated on 2026-11-04. Ones using now, today or randomness will differ when you run them.