not to mention that if you stop making it fancy and remove the words "validating ERC-20 address" with what you are really doing which is "validating whether a string is a hexadecimal one" then you get even more results in google https://stackoverflow.com/questions/11877554/validate-hexadecimal-string-using-regular-expression then you just add the checksum part for mixed (hi lo) char addresses which isn't even common among Ethereum addresses so you can get away with not implementing it in first place.
Thanks for pointing this out. However, in the first link the regex is buried in some other code in one of the comments. This also wasn't even in the first page of results on google for me (google displays different results for different individuals). As for changing the search query to "validating if a string is hexadecimal" that's a good idea, although it doesn't account for "0x" and the 40 char length so could potentially give false positives.
https://tokenmarket.net/ethereum-address-validator
https://coveenetwork.github.io/erc20-token-validator/
https://medium.com/@jgm.orinoco/understanding-erc-20-token-contracts-a809a7310aa5
https://tokenmarket.net/what-is/ethereum-token-wallets/.
Have a good day.
Thanks for these, however, I was looking for a regular expression to use in my google forms for bounty submissions. I figured someone else could use this information.