Open azjps opened 3 years ago
I'm marking this one as a wishlist item because I do not believe the current implementation of parse() can be made to enforce widths as precisely as you need. Because parse()
is based off some increasingly-complicated regexes, rather than a proper syntax parser, it those regexes start getting really complicated when you want to think about enforcing that "the width of text captured for a number is N characters" especially when the number can be in a variety of formats.
Noting that this is the same issue as reported in #99
When both the
width
andzero
specifiers are present, this should give enough information that the string to be matched has to have a minimum width ofwidth
, instead of a maximum (or in addition to a maximum):I realize that there are some tricky cases here such as with the possibility of negative signs, but it seems like the width could be calculated a bit more precisely here. Thoughts?