regex - List of allowed characters from regular expression -
does know way how extract allowed characters regular expression , construct user friendly message?
for example, providing regular expression
^[a-za-z0-9&\-\+_\.\s]{1,10}$
to like
a-z a-z 0-9 & - + _ . spaces
i using java. can imagine complicated or impossible cover types of regular expressions, maybe know library, tool or algorithm help.
thanks
yes. can done.
what need is:
- turn regexp body string.
- parse string (with regex instance) output desired list.
- apply possible regexp options (such ignore case result).
this tedious work if you're not familiar regexp. have code in production doing that, it's proprietary can't post here , it's not in java.
i guess should first ask whether there no simpler solution problem. if instance regexp constant, associate by-hand list of accepted characters.
Comments
Post a Comment