regex - How to find out the maximum and minimum length of strings that match to a given regular expression -
a theoretical question. have regex. want find strings match this. how can minimum , maximum length of these strings?
you need parse , analyse regex. classical regexes pretty straight-forward work out bounds on lengths. if include look-aheads , look-behinds rather complicated, problem tractable (i think).
i'm not aware of library methods (in java). hardly surprising. use-cases functionality must few , far between.
Comments
Post a Comment