in reply to Re^2: Regex for weird characters
in thread Regex for weird characters

you could shorten Skeeve's regex further using character classes, acutally it's the same length cause I added spaces ;)

$text =~ /[^\w\d\s,]/;

Update: switched /w for \w (++ to graff for pointing out my typo)

"Cogito cogito ergo cogito sum - I think that I think, therefore I think that I am." Ambrose Bierce

Replies are listed 'Best First'.
Re^4: Regex for weird characters
by DrHyde (Prior) on Sep 28, 2004 at 09:00 UTC
    You absolutely can not use perl's shortcut character classes. \w matches different things depending on your locale. If you have a German locale, for instance, it will match ß.