I'm doing some URL validation and want to match http, https, ftp, ftps, sftp etc.
So far I have /(https?|ftps?)/
.. If I use s?ftps?
it'll match ftp, ftps, sftp and sftps.
What's the best way to get around this? (sftps is not a valid URL scheme)
I'm doing some URL validation and want to match http, https, ftp, ftps, sftp etc.
So far I have /(https?|ftps?)/
.. If I use s?ftps?
it'll match ftp, ftps, sftp and sftps.
What's the best way to get around this? (sftps is not a valid URL scheme)
Try this:
/(ht|f)tps?|sftp/
Should work.