I’m having trouble with 2 regular expressions in PHP
1. stripping http(s):// and www.
https://www.google.be/search?sclient=psy-ab&q=regex&oq=regex
http://www.google.be/search?sclient=psy-ab&q=regex&oq=regex
https://google.be/search?sclient=psy-ab&q=regex&oq=regex
http://google.be/search?sclient=psy-ab&q=regex&oq=regex
=> google.be/search?sclient=psy-ab&q=regex&oq=regex
2. 3-30 characters, may contain a-zA-Z0-9.-_* but need at least one letter or number
Valid: -_l*96d.*
Invalid: *-_.
I’ve searched so long without any result so please help !
Many thanks!
1 Answer