Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to show what stands behind a regexp, for example, I want to print all chars covered by [A-z] in the bash.

share|improve this question
    
Do you realize that a regexp generally doesn't identify a single string? Actually this is the whole point of regexsps. I'm just trying to explain why I don't understand your question. – vtest Mar 2 '11 at 15:44
    
The regex mentioned above are'nt equals [A-Za-z] but some more Characters, and I want to know them. – mundenhof Mar 2 '11 at 16:07
up vote 2 down vote accepted

You could do something like this in Python.

import re
pattern = re.compile('[A-z]')
for ch in range(1,255):
        if (pattern.match(chr(ch))):
                print chr(ch),

Save it to a file and execute it as python your_filename. It tests every single-byte character against your regular expression and prints it out if it matches.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .