in reply to Re: How to determine if string contains non-ASCII characters ?
in thread How to determine if string contains non-ASCII characters ?
Also the character class needs to be negated to search for characters not in the range and then the result negated (here with !~ instead of =~), otherwise he will only detect if the string has any asccii chars
$string !~ m/[^\x00-\x7f]/
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How to determine if string contains non-ASCII characters ?
by ikegami (Patriarch) on Aug 19, 2009 at 17:22 UTC | |
|
Re^3: How to determine if string contains non-ASCII characters ?
by roadrunner (Acolyte) on Aug 19, 2009 at 17:25 UTC | |
by ikegami (Patriarch) on Aug 19, 2009 at 17:54 UTC | |
by moritz (Cardinal) on Aug 19, 2009 at 17:30 UTC | |
by roadrunner (Acolyte) on Aug 19, 2009 at 17:38 UTC |