How to Search for...
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
How to Search for...
Hi. Is there any way to search a document for any instances of an ASCII character value greater than or equal to 128? I want to find and whack all the ç's and ©'s, etc., without having to search them out individually. Thanks.
- Tomas Eklund
- Posts: 40
- Joined: Tue Mar 16, 2004 1:15 am
- Location: Sweden
Okay, now I'm confused... This should work:
But it doesn't. However, this works (though it really shouldn't!):Search for: [\x80-\xFF]
Replace with: (nothing)
[X] Regular expression
This third solution is however (edit:) obviously not correct but it seemed to work:Search for: [^\x80-\xFF]
Replace with: (nothing)
[X] Regular expression
Must be some kind of bug (or I'm just stupid and missing something). Oh, and I tried this in Textpad 5.0, not in 4.x.Search for: [^\x00-\x7F]
Replace with: (nothing)
[X] Regular expression
Last edited by Tomas Eklund on Tue Mar 06, 2007 10:05 am, edited 1 time in total.
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm
That's because backslash isn't a special character in a character class and a hexadecimal representation of a character isn't interpreted as such in a character class. For example, the regex [\x80] matches any of the individual characters: \ x 8 0. So [\x80-\xFF] is equivalent (by reordering and removing duplicates) to [8Fx0-\], which is equivalent to [0-9:;<=>?@A-Zx[\], which matches most characters whose ASCII value is less than 128 (particularly when the search is case-insensitive).
Try [€-ÿ] .
Try [€-ÿ] .
- Tomas Eklund
- Posts: 40
- Joined: Tue Mar 16, 2004 1:15 am
- Location: Sweden
This helps. Half way there. But I would expect that searching on this
[€-ÿ]+
to select contiguous instances of those characters. If I have ââââ in a document, I would expect that to select the entire string, not each character one at a time. Searching on e+ or even [e]+, will select the entire string eeee. What am I doing wrong?
[€-ÿ]+
to select contiguous instances of those characters. If I have ââââ in a document, I would expect that to select the entire string, not each character one at a time. Searching on e+ or even [e]+, will select the entire string eeee. What am I doing wrong?