Regular expressions pcre2 · Using regex in tools
Find all matches in Python
Return every run of digits in a string. Use raw strings so backslashes aren't treated as escapes.
import re
re.findall(r"\d+", text)
Official Regular expressions pcre2 documentation
More using regex in tools commands
- Search with grep
- Use lookarounds with grep
- Rewrite text with sed
- Match in JavaScript
- Replace in JavaScript
- Replace in Python
All using regex in tools commands · Regular expressions pcre2 cheatsheet