GREP

GREP stands for Global REplace and Print. It’s a tool used to help search text files. It uses something called Regular Expressions in order to pattern match text.

An few examples:

  • ^sausage will match all text where the line starts with sausage (^ means ‘start of line’)

  • sausage$ will match all text where the line ends with sausage ($ means ‘end of line’)

  • sausage[1-3] will match on sausage1, sausage2, sausage3 but NOT sausage4.

It is incredibly powerful and really rather complex. Indeed, there is a famous saying:

Some people, when confronted with a problem, think "I know, I'll use regular expressions."

Now they have two problems.

iThoughts supports GREP when searching for text. It also supports it when replacing text (you can even pull out bits of the matched text and use them in the replacement.) It also support it when filtering.

Common uses for regular expressions are to match on email addresses or hyperlinks or phone numbers or other ‘structured’ bits of text.

Best place to get more info is Google. There are loads of examples - some of which even work!

Good idea to get hold of a tool to help you debug them - Expressions is a good Mac option.