Skip to content

StringAndNumber

Giuseppe Cannella edited this page Feb 19, 2020 · 2 revisions
Type name example
StringAndNumber a1
import com.github.gekomad.regexcollection.StringAndNumber                        
import com.github.gekomad.regexcollection.Validate.validate                      
                                                                                 
assert(validate[StringAndNumber]("") == None)                                   
assert(validate[StringAndNumber]("1%") == None)                                  
assert(validate[StringAndNumber]("1") == Some("1"))                              
assert(validate[StringAndNumber]("11") == Some("11"))                            
assert(validate[StringAndNumber]("a1") == Some("a1"))                            
assert(validate[StringAndNumber]("Aa1") == Some("Aa1"))                                                                                                                                               
Clone this wiki locally