top of page

RegEx Search for Quotations


You can use a RegEx lookahead, lookbehind script to find text between parentheses, brakets, quotation marks, or other characters. See this example with curly quotes.

(?<=\“)(.*?)(?=\”)

[for each step see the numbered images below]

1. Start with a brief or other legal document which uses curly quotes so you can find where quotations begin and end.

2. Save the content of your searchable PDF or Word document to a .txt file.

3. Using PowerGrep select the text file, and then set it up for:

a. Action type: collect data

b. Do not filter files.

c. Do not section files.

d. Search type: regular expression.

e. Target file creation: Save results into a single file.

f. Between collected text: Line break.

4. In the search box enter the RegEx code:

(?<=\“)(.*?)(?=\”)

. . . and then just put:

\0

in the Collect box.

5. Click 'Collect' on the top toolbar and PowerGrep will highlight the results in the text file.

6. You'll end up with a separate text file with just the quotations from the original PDF.


bottom of page