digital-preservation / csv-schema

CSV Schema
http://digital-preservation.github.io/csv-schema
Mozilla Public License 2.0
98 stars 33 forks source link

zeroPad string provider #9

Open DavidUnderdown opened 8 years ago

DavidUnderdown commented 8 years ago

For 1.2 - see digital-preservation/csv-validator#122

DavidUnderdown commented 5 years ago

A corollary to this is that neither positiveInteger nor range currently reject values that are (unexpectedly) zero-padded (this is due to the fact that the EBNF allows 0 at any position). That behaviour can be emulated by adding regex("^[^0]") (a slightly more complex regex would be required if 0 itself were an allowed value)