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

assert(validate[MDY]("2sdf.0") == None)
assert(validate[MDY]("1/12/1902") == Some("1/12/1902"))
assert(validate[MDY]("12/31/1902") == Some("12/31/1902"))
assert(validate[MDY]("12/31/9999") == Some("12/31/9999"))
assert(validate[MDY]("12/31/19020") == None)
assert(validate[MDY]("-1/1/1900") == None)
assert(validate[MDY]("1/1/1900") == Some("1/1/1900"))
assert(validate[MDY]("1/-1/1900") == None)
assert(validate[MDY]("1/1/-1900") == None)
Clone this wiki locally