7. Search Terms and Options
The Action panel always provides space for at least one set of search terms: the search terms used by the
main part of the action. The action panel may provide space for four other sets of search terms used by four
other parts of the action: ´filter filesµ, ´file sectioningµ, ´extra processingµ, and ´contextµ. How many of
those are available depends on whether your chosen action type uses those parts, and whether you’ve selected
an option for those parts that requires the part to use a search term. E.g. if you set ´file sectioningµ to ´line
by lineµ then the ´file sectioningµ part of the action doesn’t need any search terms. It does when you set it to
´search for sectionsµ. If you turn on ´extra processingµ that part requires one or more search-and-replace
pairs. If you turn off ´extra processingµ, that part doesn’t show anything but its checkbox.
Search Types: Text, Regex or Binary
PowerGREP can search for four kinds of items:
Literal text: A literal word, phrase or text fragment that must appear exactly this way in the search
text (except for case).
Regular expression: A pattern describing the format of the text you want to find. This is the most
powerful and flexible way to search.
Free-spacing regular expression: A regular expression that ignores spaces and comments in the
pattern, allowing you to format it freely.
Binary data: a literal block of bytes which you enter in hexadecimal mode.
Most of the time you will be working with regular expressions. They allow you to specify the form of the text
or data you want to search for, rather than entering the exact text or data you want to find. By using regular
expressions, you can unleash PowerGREP’s full potential. Automating search or text processing tasks using
PowerGREP and regular expressions will save you a lot of time and tedious work.
If you are new to regular expressions, the regular expression tutorial in this manual will teach you everything
you need to know. Given an hour or two of practice, you will soon be up to speed.
You probably also want to have a look at RegexBuddy and RegexMagic. Both products are available
separately. RegexBuddy makes it much easier to work with the regular expression syntax to create and edit
regular expressions for use with PowerGREP and a variety of other tools and programming languages. While
editing a regular expression in PowerGREP, simply click the RegexBuddy button in the Action toolbar to edit
it with RegexBuddy. RegexMagic allows you to generate regular expressions without dealing with the regular
expression syntax at all. RegexMagic supports all popular regular expression flavors, including the one used
by PowerGREP. Simply click the RegexMagic button in the Action toolbar to invoke RegexMagic to generate
a regular expression.
All four search types allow you to use match placeholders and path placeholders. Match placeholders allow
you to insert search matches and search match numbers. Path placeholders are substituted with various parts
of the name and path of the file being searched through. Use them to search for and/or to create file
references. You can disable placeholders in the action & results preferences if they conflict with text you’re
Examples: Add line numbers, Collect page numbers and Update copyright years