View previous topic :: View next topic |
Author |
Message |
bitmonger
Joined: 03 Oct 2007 Posts: 3
|
Posted: Sat Oct 22, 2011 2:23 am Post subject: searching for hi order ASCII using \x |
|
|
I'm trying to search for — in a filename to replace with a simple dash -
The — is supposedly is ASCII hex 97. When I run a regex replacement in PFrank and put the actual — character in the search string it finds and replaces it. When I then check the detailed information - show hex codes, it shows the — as (\x2014).
When I then put \x2014 in the search string instead of — it no longer matches. If I use \x{2014}
it comes back with an error bogus escape: u"\\x"
If I use \u2014 it also does not match.
I am trying to get the \x or \u working for some other characters that don't print to screen, but am finding this extremely frustrating.
Even finding out the proper code for these is a challenge.
Any suggestions?
Thanks |
|
Back to top |
|
 |
admin Site Admin
Joined: 09 Mar 2007 Posts: 448 Location: Canada
|
Posted: Sat Oct 22, 2011 5:48 pm Post subject: |
|
|
Sorry - it looks like hex code replacement only works with codes that have 2 characters. eg. \x30
I tried different ways to try make \x2014 work but was unsuccessful. THis is a limitation of the python regex library.
For the case of '—' or any other printable character, you can just paste the character (instead of the hex code) into the search or replace column of the renaming creator.
It doesn't look like there is any way to search for unprintable characters unless the corresponding hex code is only 2 characters.
Peter. |
|
Back to top |
|
 |
|