Skip to content
Giuseppe Cannella edited this page Feb 19, 2020 · 3 revisions
Type name example
DMY2 1-12-1902
import com.github.gekomad.regexcollection.DMY2
import com.github.gekomad.regexcollection.Validate.validate

assert(validate[DMY2]("1-12-1902") == Some("1-12-1902"))
assert(validate[DMY2]("12-31-1902") == None)
assert(validate[DMY2]("31-12-1902") == Some("31-12-1902"))
assert(validate[DMY2]("31-12-9999") == Some("31-12-9999"))
assert(validate[DMY2]("12-31-9999") == None)
assert(validate[DMY2]("12-31-19020") == None)
assert(validate[DMY2]("-1-1-1900") == None)
assert(validate[DMY2]("1-1-1900") == Some("1-1-1900"))
assert(validate[DMY2]("1--1-1900") == None)
assert(validate[DMY2]("1-1--1900") == None)
Clone this wiki locally