RegExp Magic

Need something nice? RegExp matching something? You remember you used one once but can't remember how you builded it cause it was pain in the a...? Always forgot to write them down? Here are some of may Favourites

Matching IP and Port:

^(?<IP>(?:(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])\.){3}(?:(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5]))):(?<PORT>(?:[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]))$

Validate allowed String characters with minimum length (e.g. passwords):

^(?=.*[A-Za-z])(?=.*\d)(?=.*[_\-=@$!%*#?&])[A-Za-z\d@_\-=$!%*#?&]{8,}$

Limit allowed Characters for names:

^[a-zA-Z0-9àáâäãåąčćęèéêëėįìíîïłńòóôöõøùúûüųūÿýżźñçčšžÀÁÂÄÃÅĄĆČĖĘÈÉÊËÌÍÎÏĮŁŃÒÓÔÖÕØÙÚÛÜŲŪŸÝŻŹÑßÇŒÆČŠŽ∂ð ,.'\-_\(\)]+$

Validate phone number:

Phone number must start with '+' followed by 1-49 digits. No whitespace allowed. e.g. +496641234567

^[\+]((?:[1-4][0-9]|[1-4]))([0-9]{1,13})$