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:

  1. turn regexp body string.
  2. parse string (with regex instance) output desired list.
  3. 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

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -