URLs - gekomad/scala-regex-collection GitHub Wiki
import com.github.gekomad.regexcollection.Validate.validate
import com.github.gekomad.regexcollection.URL
assert(validate[URL]("http://www.aaa.com") == Some("http://www.aaa.com"))
import com.github.gekomad.regexcollection.Validate.validate
import com.github.gekomad.regexcollection.URL1
assert(validate[URL1]("http://www.aaa.com") == Some("http://www.aaa.com"))
Type name |
example |
URL2 |
http urls with www |
|
http://www.aaa.com |
|
HTTP://www.example.com/wpstyle/?p=364 |
import com.github.gekomad.regexcollection.Validate.validate
import com.github.gekomad.regexcollection.URL2
assert(validate[URL2]("http://www.aaa.com") == Some("http://www.aaa.com"))
import com.github.gekomad.regexcollection.Validate.validate
import com.github.gekomad.regexcollection.URL3
assert(validate[URL3]("https://www.aaa.com") == Some("https://www.aaa.com"))
Type name |
example |
FTP |
ftp and ftps urls |
|
ftp://aaa.com |
|
FTP://aaa.com |
|
FTPS://aaa.com |
|
ftps://google.com:8080/url? |
import com.github.gekomad.regexcollection.Validate.validate
import com.github.gekomad.regexcollection.FTP
assert(validate[FTP]("ftp://aaa.com") == Some("ftp://aaa.com"))
import com.github.gekomad.regexcollection.Validate.validate
import com.github.gekomad.regexcollection.FTP1
assert(validate[FTP1]("ftp://aaa.com") == Some("ftp://aaa.com"))
Type name |
example |
FTP2 |
ftps urls |
|
ftps://aaa.com |
|
FTPS://aaa.com |
import com.github.gekomad.regexcollection.Validate.validate
import com.github.gekomad.regexcollection.FTP2
assert(validate[FTP2]("ftps://aaa.com") == Some("ftps://aaa.com"))
Type name |
example |
Domain |
no www no protocol |
|
plus.google.com |
|
google.com |
import com.github.gekomad.regexcollection.Validate.validate
import com.github.gekomad.regexcollection.Domain
assert(validate[Domain]("google.com") == Some("google.com"))