Hello every body
how can i find words start with letter r and end with letter t (as example)?
\b is a word boundary, so it marks the start of your word. r is the letter r at the start of the word. [a-zA-z] is a class that contains all upper and lowercase letters from a to z. the + signifies "one or more matches" and the ? is a shortest match limiter (which I think is not required here). t is the letter t at the end of your word, and \b is the word boundary signifying the end of the word.
I think Peter's right, that the ? isn't strictly necessary here, since the found string is already limited by the word boundaries and the character set to search on doesn't include punctuation or spaces. It won't hurt anything either.
Re: the + meaning one or more match, what this means is that it will find anything that begins with r and ends with t, no matter how many letters are in between. So all of the following would be found using that GREP:
rat
rot
root
robot
retirement
Jongware has an extremely helpful script called "What the GREP" (a free download) that will pull apart any GREP string and tell you exactly what it's doing:
The best intro to GREP in InDesign is Peter Kahrel's "GREP in InDesign CS3/CS4," well worth the $10.
North America
Europe, Middle East and Africa
Asia Pacific