I'm trying to validate a URL using a Regex with PHP. I need a pattern that considers valid:
- a well formed URL;
- http://www.domain.PF (this PF is very imporant, no other extension is valid);
- https://www.domain.PF
- ftp://...;
- domain.PF;
- www.domain.PF;
Any other is not valid, so you can't have ssh://, a .com domain, etc.
I tried the following pattern:
/(((http|ftp|https):\/{2})+(([0-9a-z_-]+\.)+(pf)(:[0-9]+)?((\/([~0-9a-zA-Z\#\+\%@\.\/_-]+))?(\?[0-9a-zA-Z\+\%@\/&\[\];=_-]+)?)?))\b/imuS
but I've lost many hours (and hairs) trying to make it work the way I need it to work.
Any suggestion is appreciated.