Please follow the below template, it will help us to help you!
Expected Behaviour:
I wish to match domains that has 5 or more chars, and contains at least one number or one - or one _
basically block all the rubbish domains, usually been used for virus, phishing and ads.
But, be aware that not everything that appears to work on that site will work properly in Pi-Hole. Pi-Hole uses POSIX ERE, which does not allow some code that will pass the checks on regex101.
The best way to check in Pi-Hole after you have tested the regex elsewhere - set REGEX_DEBUGMODE=true per the documentation: Configuration - Pi-hole documentation
This will trigger an entry in /var/log/pihole-FTL.log when a regex is triggered. Then, live tail this log and do some dig commands for domains that you think should be blocked by that regex. If the domain is blocked, it will return as NULL (assuming default settings for blocking mode) and the regex that blocked it (for the first block only) will appear in the FTL log.
Thanks eejeel. I did test the exp on that website, and also using PCRE(PHP) before putting it into pihole. The exp seems to be working fine on the test site, suits for my needs:
match domains that has 5 or more chars, and contains at least one number or one - or one _