Extract by Text Pattern

Overview

Extract by Text Pattern scans page text for keywords or regular expressions and collects every matching page into separate output files — one file per criterion. Pages collected for a single criterion can be non-contiguous within the source document.

This is useful for pulling all pages that mention a particular client name, project code, or legal term from a large PDF.

Video: Extract by Text Pattern shown step by step, with narration.
The Extract by Text Pattern dialog
The Extract by Text Pattern dialog.

Note

The dialog remembers the settings it last ran with (never the passwords), and an empty output folder starts as the folder of the open PDF. Browse... opens at the folder already typed.

Security... reads Security (on)... while password security is switched on for the output files, for example after you choose a configuration or load a profile that sets passwords.

The default file name is {filename}_{n}. {tag} (or {match}) is the text the pattern matched. An area applies only to the pattern added while Restrict the pattern being added to an area is ticked; the list shows it after that pattern as (area: left, bottom, right, top), in points. Select a criterion and click Edit (or double-click it) to change its pattern or area; Pick Area... draws the area on a page.

How to use

  1. Open the PDF you want to search.
  2. Go to Plug-Ins > Split > Extract by Text Pattern.
  3. Type a pattern in the text box and click Add to build the pattern list. Repeat for additional patterns.
  4. Optionally click Regex Library to insert a saved regular expression into the pattern field.
  5. Choose the output folder and file-name pattern.
  6. Click OK to run the extraction.

Options

OptionDescription
Patterns One or more regular expressions (or plain text strings). Each criterion produces a separate output file containing all pages that match it. Use Add to append and Remove to delete the selected entry.
Regex Library Opens the Regular Expression Library so you can insert a saved pattern into the pattern field.
Search annotation text When checked, annotation content (comments, sticky notes, free-text annotations) on each page is also searched in addition to the page body text.
Output folder The destination folder for extracted files. Click Browse to select a folder.
File pattern Controls the output filename. Use {tag} (or {match}) to embed the text the pattern matched (characters not allowed in file names become _), {filename} for the source name and {n} for a sequential index. All the pages one pattern matches go into one file, so {tag} has one value per pattern: the text matched on the first matching page (the first capture group, when the pattern has one). A regular expression such as FM-[0-9]+ that matches different text on different pages therefore names the file after the first of them. The default pattern is {filename}_{n}. The characters : * ? " < > | cannot be typed into the pattern itself.
Open output files after creation Opens each generated file in Acrobat after the operation completes.

Tip

Extract by Text Pattern always ignores capitals — figure 12 and Figure 12 both match, and there is no option to change that. New to patterns? See Understanding Regular Expressions.

Warning

A pattern beginning (?i) is rejected as invalid. That prefix works in some other programs but not here. You do not need it: this feature already ignores capitals. Where a feature does not, put the choice in the pattern itself — [Ss]ection matches both “Section” and “section”. See Capitals and matching.

Note

A single page may match multiple criteria and will appear in each corresponding output file. Criteria that match no pages produce no output file. The summary gives the number of files saved and the folder, and lists any criterion that matched no page; if no criterion matches any page it says so, and from Watch Folder or the command line such a run is reported as failed.

See also