Macro to find ASCII > 127 chars

Help with writing and playing macros

Macro to find ASCII > 127 chars

Postby hveld » Tue Nov 07, 2006 9:54 am

Hi,

I need to check files for characters with ascii code [decimal] > 127, so I need a macro that will either highlight all such, jump to each such char and allow me to edit it, or at least replace all such chars with a space.
Is there an easy way to do this?
I tried some things but all unsuccessful :(

thanks
User avatar
hveld
Basic User
Basic User
 
Posts: 42
Joined: Tue Nov 16, 2004 12:00 am

Re: Macro to find ASCII > 127 chars

Postby Mofi » Tue Nov 07, 2006 12:17 pm

That's simple. Search for all characters which are not <= 127 and >= 32 except tab, CR, LF and FF:

HexOff
UnixReOff
Find RegExp "[~^t^r^n^b !"#^$^%&'()^*^+,^-./0-9:;<=>^?@A-Z^[\^]^^_`{|}^~]"

Can be also done with Unix or Perl regex engine if you preferone of these engines.

This regex search string can be use also with Find In Files or Replace In Files.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4049
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Macro to find ASCII > 127 chars

Postby hveld » Wed Nov 08, 2006 3:13 pm

Mofi, thanks for showing me the right direction. Indeed I can simply use a regex in the search box, this one works fine
[\x80-\xFF]{1}
(using the perl engine)

Strange enough, the equivalent (as I think)
[^\x01-\x7F]{1}
doesn't work
User avatar
hveld
Basic User
Basic User
 
Posts: 42
Joined: Tue Nov 16, 2004 12:00 am


Return to Macros