a certain quantity-range of characters

General questions about using TextPad

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

Post Reply
redcairo
Posts: 39
Joined: Fri May 06, 2011 6:34 am

a certain quantity-range of characters

Post by redcairo »

This has to be obvious but I must not be reading the right things!

I know that [something]+ will find more than 0/1 of something

How do I say, find somewhere between 3 and 12?

In this search:

( )([a-z]+[0-9][0-9][t\|q])

I need the characters (a-z) to ONLY be found there are at least 3 chars but no more than 12 chars.

So (space)maca12q and (space)millerenr08t would both be found.
But ab12t and somethingsomething12q would not.

How do I specify that "quantity" of characters thing?

Thanks so much!!

PJ
ak47wong
Posts: 703
Joined: Tue Aug 12, 2003 9:37 am
Location: Sydney, Australia

Post by ak47wong »

Click Help in the Find dialog and then click Regular Expression. The section Interval Operator is what you're after.

To find at least 3 and no more than 12 instances of a-z, use: [a-z]{3,12}

Also, are you aware that [t\|q] matches either t, \, | or q? To match either t or q, you only need [tq].

So your expression should be: ( )([a-z]{3,12}[0-9][0-9][tq])
redcairo
Posts: 39
Joined: Fri May 06, 2011 6:34 am

Post by redcairo »

Ohhh I didn't know that about the | either -- thank you very much!!
Post Reply