|#||Python regex||What it matches|
||Phone numbers like
||Comma-separated currency like
||Numbers having 2 to 10 digits.|
Find matching text using Python regex online
awk isn't handy if you want to extract different columns on different rows.
sed is line-oriented, but you want to extract text no matter whether they are in a line or not.
Regex syntax of awk/grep/sed varies slightly, which is a painful to make it right sometimes.
My use cases (see details in this blog post):
- Find all words beginning with a specific prefix.
- Extract fields out from structure text, like Protobuf Message definitions.
- Find specific attributes like hrefs of links in HTML/XML.
- Python Regex Cheat Sheet | ShortcutFoo
- Pythex: a Python regular expression editor, useful to test regex patterns