bootstrap-validate icon indicating copy to clipboard operation
bootstrap-validate copied to clipboard

Regex Validation Issue - Pipe operator "|" is used as rule separator

Open dominicklee opened this issue 3 years ago • 2 comments

Hello, I am having an issue with using Bootstrap Validate for my regex. I must be able to use the pipe operator as part of my regex syntax. Can you please show any alternative to achieve the following:

regex:([0-9]|0[0-9]|1[0-9]|2[0-3]):([0-5][0-9])\s*([AaPp][Mm]):Please enter a valid time

I want to be able to validate text that says "10:30 am" or "9:00am"

Because of the pipe operator. "|" is used as rule separator.

Originally posted by @PascaleBeier in https://github.com/bootstrap-validate/bootstrap-validate/issues/50#issuecomment-516749943

dominicklee avatar Jul 19 '22 14:07 dominicklee

Hey, thanks for reaching out. This is a limitation of this library and will not be able tackled in the near future. You could use input masking too, e.g. https://imask.js.org/

PascaleBeier avatar Jul 20 '22 19:07 PascaleBeier