to find all the words have 5 letters

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
eddy.fr
Posts: 5
Joined: Wed Jul 04, 2007 7:23 pm
Location: Le Perreux sur Marne
Contact:

to find all the words have 5 letters

Post by eddy.fr »

Hello,
I try to translate in english my french langage.

In a document, i want to find all the words with five letters. If you want to help me, thanks in advance.

eddy
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

Try this:

Find what: [^[:alpha:]][[:alpha:]]{5}[^[:alpha:]]

You could do this twice, the first time check Mark All to bookmark the lines.
Then run again, checking Find Next to pick out the word(s) on the lines.

-----------------
Edited: I just noticed that does not find the last word on a line, need to modify to handle that ......
Edit2: This also selects words that start or end with a number... working on corrections....
Hope this was helpful.............good luck,
Bob
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

This one is better, at least it does no longer picks up words with numbers

Find what: [[:space:]][a-zA-Z]{5}[[:space:]]

But it is still missing the first and last words on a line. Still need to modify to ignore ^ and \n
Hope this was helpful.............good luck,
Bob
bveldkamp

Post by bveldkamp »

\<[a-z]{5}\> should work
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

Thanks bveldkamp

I did not know I could use {n} to control the length of word inside \< \>. :oops:
I had only used it with [ ] or "." or specific chars before.

One more tool to put in the toolbox. :D
Hope this was helpful.............good luck,
Bob
Post Reply