Random Regex

I’m not saying that these are anything impressive. I just don’t keep a record of the regex that I do and sometimes I don’t want to think.

If you’re not bothered to think either, then I hope that this helps you.

Disks in Linux

\/dev\/[a-z]+[0-9]+(|n[0-9]+)(|p[0-9]+)

IP - sucky

This technically pulls the IP however it’s not the best because the periods (.) are optional. It is small though.

"([0-9]{1,3}(|\.)){4}"

IP - Accurateish

This will pull IP’s with high confidence.

([0-9]{1,3}\.){3}[0-9]{1,3}