Script to Kill All UniCode Characters, from Files' Name, using a Regular Expression

Posted on 2007-12-06
Last Modified: 2008-02-01
I have many downloaded files which contain, in its name, UniCode characters (such as Chinese, Japanese, Korean, Arabic, Hebraic, Russian) which are seen as "Illegal Characters" by English version of Windows XP's explorer.exe... This causes serious troubles when managing such files...
Thus, I would like to get a script to automatically delete such characters from files' name, in order to avoid problems when trying to access them...

PS.1 - even when downloading, for example, an eBook (or application) totally written in English, stupidly the files' names can contain such unicode/illegal characters (I think that's because they are hosted in foreign servers)...

PS.2 - This question is related to:

Although "ReNamer" is a superb renaming tool; I still to want/need to get a script, as a "light-weight" and quickly/rapidly solution "on-the-fly"...

Someone, outside EE, told me about REGULAR EXPRESSIONS...  Please give a look at:


My problem is that I do not know how to make the RegExp...

I can use VBScript, AutoIt, Perl, Python, Ruby, Tcl-Tk, or whatever, but I need some help...


Question by:asgarcymed
  • 4
  • 2
LVL 27

Expert Comment

ID: 20420709
With empty string.

Would allow:

Add any other characters you want to allow.

Author Comment

ID: 20421038
I need to allow: All English/German and Latin (Portuguese/Spanish/French/Italian) letters, lower and upper case [A..Z; À; Ã; É; Ê; Í; Ì; Ó; Ò; Õ; Ñ; Ç]
!; ""; #; $; %; &; @; £; §; {; }; '; «; »; [American and European Keyboard]

I very urgently need to kill ALL Chinese, Japanese, Korean, Arabic, Hebraic, Russian characters (all letters are "crazy")...

Could you please help?

You "must" look at:

Thank you very much
LVL 27

Expert Comment

ID: 20421236
With empty string.

Would cover:
\p{InBasic_Latin}: U+0000..U+007F
\p{InLatin-1_Supplement}: U+0080..U+00FF
\p{InLatin_Extended-A}: U+0100..U+017F
\p{InLatin_Extended-B}: U+0180..U+024F
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

LVL 27

Accepted Solution

ddrudik earned 500 total points
ID: 20421521
Did you need any additional help implementing the regex pattern?

A VBSCRIPT example:
Set regEx = New RegExp
regEx.Global = True
teststring = "<your string>"
regEx.Pattern = "[^\u0000-\u024F]+"
teststring = regEx.Replace(teststring,"")

Author Comment

ID: 20421870
Thank you very much!! You made may day shining!!
LVL 27

Expert Comment

ID: 20422052
Thanks for the question and the points.  Glad I could help.

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question