Hello,
I'm trying to parse ftp URI using scala regular expressions. My URI looks like this:
val uri="
ftp://user:pass...@server.com/directory/file.xml"
My regex looks like this (according to URI spec):
val Regex = """^ftp://(.*):(.*)@(.*)/(.*)""".r
However when I match by this regex URI is not parsed correctly:
uri match {
case Regex(userName,password,host,fileName) => ...
}
userName > user
password > password
host >
server.com/directoryfileName > file.xml
I'm not sure why regex recognizes two forward slashes, but not one forward slash?
I'd like to get this back:
host >
server.comfileName > directory/file.xml
I'd appreciate any help in this matter.
Regards,
M