Finding weird characters with GREP

780 views
Skip to first unread message

kukubura

unread,
Oct 19, 2010, 2:22:12 PM10/19/10
to TextWrangler Talk
I have a document that has some weird symbols from foreign alphabets
that don't display properly. I was hoping to search for them (since
this is a looooong document) but the GREP code I wrote finds the
accented characters that display properly but not the ones that didn't
even import correctly.

Here's the GREP pattern:
(?!([\W_a-zA-Z0-9]))

It found this: È

But it didn't find these (I don't know if they're even going to
display here):
¸ and ¯

Again, these are weird symbols that appear because some other symbol
isn't supported, I guess. They aren't a-z or 0-9 so TW should have
found them, no? Is there some other way to look for weird characters?
Thanks!

Thomas Humiston

unread,
Oct 19, 2010, 4:28:07 PM10/19/10
to textwr...@googlegroups.com
I'd forget Find altogether and choose this instead:
Text > Zap Gremlins

I usually choose the "Replace with" option, then use find and replace
to clean up any remaining oddities. A character that normally wouldn't
appear in your document (such as ^ or %) makes a good replacement.

Tip: If you save your document before using the Zap command, it's easy
to tell if any gremlins were present, because the black dot will only
appear in the toolbar (and/or the window's red close box) if the
document has changed since the last save. No dot, no gremlins (hence
nothing to find and clean up).

If your need for replacing non-ASCII characters is more advanced, the
Grep section in TextWrangler's Help includes info on matching
hexadecimal characters.

Reply all
Reply to author
Forward
0 new messages