There are few places to get proper analysis of your regular expressions online. One of which is www.regexr.com
My request is simple: Offer a similar service for the regular expression language used in Pi-hole
It is POSIX ERE plus specific extensions (if any): Redirecting...
This does not explain what is what and why. Testing I can also do with simply adding to Pi-hole and check if there are compilation errors. Or using the new test function for regex that is being worked on. The request is more for training and explaining why something is behaving as it is than for checking the outcome.