#real_devastatiaI use filter_var to validate URLs and e-mail addresses. Validating them with regex is a rabbithole I don't want to go down. I messed with it a long time ago and discovered there are as many different solutions as there are e-mail addresses.