TEA Tutorial

TEA HomeTutorial IndexPrevious StepNext Step


1.9 Combining Patterns

Combining templates and anagrams in one pattern (see Step 5) is the simplest way of specifying two different requirements that a word must satisfy. TEA also provides a more general way to combine multiple patterns with AND (&), OR (|) and NOT (!) operations.

Suppose you are looking for words with earth at the beginning or the end, but not those (such as hearths) with it anywhere else. This problem can't be simply expressed with a single TEA pattern, but you can use earth* to find the words with earth at the beginning and *earth to find ones with earth at the end (see Step 4). You can use the OR character (|) to combine these two in the way you want:

Step 9 initial image

Type earth* | *earth into the box below the Pattern label and click on the Word Search button. TEA finds lots of possibilities, but they should all have earth either at the beginning or at the end. Notice that spaces before and after patterns aren't significant - they only make a difference in the middle of patterns (see Step 8).

You can also use two other characters to represent logical operations: the AND character (&) indicates that the two surrounding patterns must both be matched for a word to be shown; and the NOT character (!) indicates that you are only interested in words where the pattern doesn't match.

The next example shows AND and NOT in action. Imagine you are looking for words containing the first five letters of the alphabet ABCDE plus any other letters. The pattern ;*abcde solves the problem; but suppose you notice that a lot of words ending ED are appearing and you definitely aren't interested in such words. You could use a combination of patterns to achieve this:

Step 9 final image

Type ;*abcde & !*ed into the box below the Pattern label and click on the Word Search button. TEA finds lots of possibilities, but none of them should end ED. In other words, only words or phrases that match the first pattern and do not match the second pattern are shown.

In the next step, we'll learn a further way to combine patterns to solve complicated problems.


Relevant Help Sections

Logical Operations

TEA HomeTutorial IndexPrevious StepNext Step


You can use the Contact Us Form to comment on this page.
Last updated: $Date: 2010/06/06 20:40:38 $
Material Copyright © 2010 Crossword Man