Skip to content
Giuseppe Cannella edited this page Feb 19, 2020 · 2 revisions
Type name example
Time 8am
import com.github.gekomad.regexcollection.Time                     
import com.github.gekomad.regexcollection.Validate.validate        
                                                                   
assert(validate[Time]("8am") == Some("8am"))                       
assert(validate[Time]("8 pm") == Some("8 pm"))                     
assert(validate[Time]("11 PM") == Some("11 PM"))                   
assert(validate[Time]("8:00 am") == Some("8:00 am"))               
                                                                   
assert(validate[Time]("8a") == None)                               
assert(validate[Time]("8 a") == None)                              
assert(validate[Time]("8:00 a") == None)                                                                                       
Clone this wiki locally