I struggle a bit with regex -- like I've said before. I speak regex, but I'm not fluent. It's something I'm working on. Today I ran across a couple sites that really help and I wanted to share them.
The first breaks down a regex statement visually. The second does it in words.
So on Advent of Code day 4 we had this regex to pick out hex color codes.
^#(?:[0-9a-fA-F]{1,2}){3}$
Looking at that visually, using https://www.debuggex.com/ we see:
The second site https://regex101.com/ gives this explanation:
Nicely explained, step by step.
As another example, here's a regex that picks out phone numbers.
/((\d{3})(?:\.|-))?(\d{3})(?:\.|-)(\d{4})/g
Check it out in visual form:
These are great tools that I'm going to keep handy. Regex is already starting to feel less foreign.