json-gate icon indicating copy to clipboard operation
json-gate copied to clipboard

Pattern attribute should accept regexp objects as well as strings

Open lini opened this issue 9 years ago • 0 comments

Right now the pattern attribute in the schema is always supposed to be a string. However, if we want a regular expression which ignores case, it cannot be done with a string pattern. For example: pattern: "^Phone" will not match the string "phone" Even if i change it to "^[Pp]hone" it will not match an input of "PHONE". I would need to use "^[Pp][Hh][Oo][Nn][Ee]" which is ridiculous.

If pattern can be set to /^phone/i or RegExp("^phone", "i") then it will be a lot easier to use.

lini avatar Oct 16 '14 14:10 lini