July 15th, 2010, 11:15 AM
FTP validation regex
I would like to find a regular expression to validate (in perl) a ftp url.
For example: ftp://firstname.lastname@example.org/path1/example.txt
Someone can help me?
Thank you so much
July 15th, 2010, 01:31 PM
Google around for a regular URL regular expression, and them make sure (a) it supports FTP only, and (b) optionally (?) includes the username/password pair.
How specific does it have to be? RFC correct, or just "pretty close"? If there's an error would you rather it be a false positive or false negative?
July 16th, 2010, 04:09 AM
Thanks for your quick response
Ideally, the filter should be as standard as possible ... and if in doubt, always be negative
I have not been able to find anything in Google: (
Originally Posted by requinix
July 16th, 2010, 04:29 PM
Really? Add "ftp" or "perl" for even better results.
Originally Posted by icsbcn
Like I said, take one of those that includes the http prefix and allows for usernames+passwords and change it to use an ftp prefix instead.