On 11/08/2006 09:00 PM, Bernard van de Koppel wrote:
Hi,
I am trying to filter out strings with odd characters in directories.
In filenames, only the names with alfabetical characters and the
charaters with graves like igrave (ì) are allowed.
sofar I tried something like
$string =~ tr#a-zA-Z[xec][x8d][xc3][xac]##cd;
This will however return only the alfabetical caracters. How can I
include the engrave characters???
Below the hex encoding of the files as shown with deco.
76 65 6e 65 72 64 c3 ac venerd*ì*
Hope someone can help.
Bernard
I think the [[:alpha:]] character class was invented just for this. You
can remove non-alphabetic characters from a string, e.g.
$string =~ s/[^[:alpha:]]+//g;
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>