Lines without 'special' characters.

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
Crispy
Posts: 7
Joined: Tue Feb 21, 2006 9:06 am

Lines without 'special' characters.

Post by Crispy »

I'm attempting to open an .mdi file in textpad, when I do I can see all the valid text that I want in page size chunks, seperated by all the special characters that conatin the .mdi formating.
How can I go about marking either set of lines?
I know that I want to identify all the lines that are only a-z, A-Z, 0-9 and/or punctuation against those containg at least character that is 'special.'

Can I do this by ANSI value? - It appears that the lines I don't want will have at least one character that is ANSI 191 or higher (except maybe 215 & 247)

Any ideas where I should start?

I did try to cut & paste some example lines into this post, but the preview wouldn't work - must be those 'special' characters!
Many thanks.
Michael Cook

Post by Michael Cook »

[[:cntrl:]]+

This will find control characters. Is that what "special" means?
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Crispy seems to be looking for fine control over which characters are to be treated as special.

The special characters as Crispy has defined them can be found with the regular expression
[¿-ÖØ-öø-ÿ]
That expression can be used to find lines that contain any special characters.

The non-special characters can be found with
[^¿-ÖØ-öø-ÿ]
(Non-empty) lines that contain only non-special characters can be found with
^[^¿-ÖØ-öø-ÿ]+$
Crispy
Posts: 7
Joined: Tue Feb 21, 2006 9:06 am

Post by Crispy »

Ben, that's absolutely bang on the money.
Many, many thanks!
Post Reply