const rules = {
username: 'alpha_numeric'
}
// or
const rules = {
username: [
rule('alpha_numeric')
]
}
Makes sure the field under validation is alpha numeric only.
The regex used is /^[a-z0-9]+$/i
.
const rules = {
username: 'alpha_numeric'
}
// or
const rules = {
username: [
rule('alpha_numeric')
]
}
For customized build, you can import this rule as follows.
import { alphaNumeric } from 'indicative/builds/validations'