Well "T followed by 8 letters or numbers" is this:
code:
T[A-Z0-9]{8}
However, if you need to be sure that is isolated (i.e.
not found in "ATTENTIVENESS"), then you want to use word boundary markers also:
code:
\bT[A-Z0-9]{8}\b
The
\b matches the zero-width boundary between a "word character" (alpha,number,underscore) and a "non-word character" (everything else), in either direction.
If you have different/stricter rules, potentially a different expression is needed.
Also, that'll still match "TENTATIVE" though - so you'll need to clarify if you want, for example, at least 1 numeric digit, and if the position of that number might be important.
Similarly, is case important - should "t112r045n" match?
(If so, you can probably plonk
(?i) at the start to set case-insensitive mode.)
EDITED: 22 Feb 2010 18:26 by BOUGHTONP