Home » Javascript » How to stop regex conflicting with : in bootstrapValidate plugin

How to stop regex conflicting with : in bootstrapValidate plugin

Posted by: admin August 19, 2018 Leave a comment

Questions:

I am using the following regex with bootstrapValidate plugin to validate a field.

bootstrapValidate('#input', 'regex:/^(my:track:[a-zA-Z0-9]{22}$)/:Invalid input')

The docs state to use this expression:

bootstrapValidate('#input', 'regex:^[a-z]+$:Please fulfill my regex')

The issue is I am using : inside the regex match and conflicts with the separator options.

How can I stop the : regex conflicting? Thanks!

Answers: