On Wed, Aug 23, 2017 at 05:55:59PM +0100, Robert Wilton wrote: > My definition of 'better' is: > - is relatively easy for a human to read/review.
likely subjective > - doesn't exclude any valid values. obviously > - doesn't check numerical ranges, only the number of digits. seems arbitrary, why are numerical ranges special? > - is simple enough to trivially work with most normal regex engines. and I thought we rely on a standard... > - otherwise the pattern is as strict as possible given the constraints > above. > > So here is the point I think: > > > > It is desirable that regexes are as strict as they can be. > > However, if regexes become so complicated that they become a > > verification and maintenance problem by themself, then less strict > > regexes may be a better choice. > I partly agree, but the line of where I would define a regex as being too > complicated may be different from you ;-). Very likely and as frustrating as it is, there likely is no precise guideline that does not leave room for interpretation. For me, the more complex the pattern gets (and my bar for 'complex' is very low), the more I am interested in test cases (valid data that must be accepted by the pattern and invalid data that must be rejected by the pattern). But yes, all this is somewhat subjective. /js -- Juergen Schoenwaelder Jacobs University Bremen gGmbH Phone: +49 421 200 3587 Campus Ring 1 | 28759 Bremen | Germany Fax: +49 421 200 3103 <http://www.jacobs-university.de/> _______________________________________________ netmod mailing list [email protected] https://www.ietf.org/mailman/listinfo/netmod
