why I get error when I set regex like this
this.validator = new Validator({ avatar: '', phone_no: 'numeric|max:12', address: 'regex:^[a-zA-Z0-9\s\.\-\/,]+$', city: 'regex:^[a-zA-Z\s]+$', postcode: 'numeric', state: 'regex:^[a-zA-Z\s]+$', country: 'regex:^[a-zA-Z\s]+$' })
this is example of test string on that regex https://regex101.com/r/tvUtu0/1
Error Occured :-
Uncaught SyntaxError: Invalid flags supplied to RegExp constructor ']+$' ( IF I PUT REGEX ON COMMA )
The address field format is invalid. ( IF I PUT REGEX ^ ...... + $ )
Versions:
Description:
why I get error when I set regex like this
this.validator = new Validator({ avatar: '', phone_no: 'numeric|max:12', address: 'regex:^[a-zA-Z0-9\s\.\-\/,]+$', city: 'regex:^[a-zA-Z\s]+$', postcode: 'numeric', state: 'regex:^[a-zA-Z\s]+$', country: 'regex:^[a-zA-Z\s]+$' })
this is example of test string on that regex https://regex101.com/r/tvUtu0/1Error Occured :-