alpha numeric and spaces validation
Hi guys, i tried alpha_num to validate and restrict input for letters and numbers but why is that spaces is not included?
regards
ci
[
'field' => 'regex:[a-zA-Z0-9\s]+',
]
@bestmomo tried it works but i also need the numeric to be accepted, what should i add to make it accept also the numeric input?
@pmall it gives me an error message
@pmall
here is the error message i got
preg_match(): Unknown modifier '+'
[
'field' => 'regex:/[a-zA-Z0-9\s]+/',
]
@pmall it accepts special characters, i used this instead
regex:/(^[a-zA-Z0-9 ]+$)+/
Cleaner :
[
'field' => 'regex:/^[a-zA-Z0-9\s]+$/',
]
Please or to participate in this conversation.