If you haven’t dealt much with regular expressions, The Regex Coach is an invaluable learning tool.
Give it a pattern at the top, and in a demo string at the bottom, it highlights the matching segments.
You’ll get waaay more benefit from sed, grep, and string replacement in programming languages once you’ve trained a bit with this.
When you put this knowledge to use, there will be some variation from environment to environment when it comes to the fancy tricks: basic regex < extended regex < perl regex. Some commands have args to choose which syntax. And depending on quoting, you may need to backslash-escape stuff.
This general regex reference is excellent (nav on the left of that page links to more reference pages, as does the heading of each table).