Are there some regular expression experts out there?

I have a software, which uses regular expressions as check mechanism on how a string should look like. I want to achieve that only "standard characters" are "valid", but no character which a file system doesn't like...

currently this one makes me headache:
Code:
%^[-A-Za-z0-9" "_]{1,40}
can someone explain me what these things mean?
the things in the brackets should mean the following characters: "-", characters from A to Z (upper and lower case), numbers from 0 to 9, " " (blank) and "_" (underscore)
{1,40} should mean from first sign to sign number forty. Is this still regular expression?
%^ --> what should that mean?

can someone please bring light into that thing to me?

Thanks in advance!