Using subexpressions in the Find what field, you can mark and preserve parts of…an expression that can be referred to and put back as part of the change…operation in a GREP search.…At the end of the Find what field, the Special characters for Search menu has…quite a few options that are GREP specific:…things like Wildcards, Locations, Repeat, Match, and so on.…At the end of the Change to field, it's a much shorter menu.…The only thing here that's really GREP-specific is this Found submenu.…
The metacharacters that are inserted from this submenu refer to text that has…been found by the expression in the Find what field.…The first option, Found Text, puts in $0, which refers to everything that was…found in the Find what expression.…The others, which would be Found Text 1 through Found Text 9, refers…specifically to any subexpressions that existed within that expression.…The first subexpression would be Found Text 1, the second, Found Text 2, and…the third, Found Text 3 and so on, and so on, up to 9, at which point InDesign stops counting.…
Author
Released
11/18/2009- Using metacharacters, the building blocks of GREP
- Describing text that may not exist with zero operators
- Applying multiple character styles to the same text with GREP styles
- Eliminating orphaned words at the ends of paragraphs
- Preserving and recalling subexpressions
- Customizing a GREP-based text cleanup script for long documents
Skill Level Intermediate
Duration
Views
Q: In the “Dynamically fixing orphaned words with GREP” tutorial the author uses the term:
(?<=\w)\s(?=\w+[[:punct:]]+$)
In an earlier course the author described the + (one or more) modifier as unusable in a lookbehind or lookahead i.e. (?<=.+). What's the difference here?
A: The limitation mentioned in an earlier movie referred only to positive lookbehind and negative lookbehind. I was able to use the one or more times (+) metacharacter in the positive lookahead portion of the expression because that limitation doesn't affect either positive or negative lookahead. It's only when looking backward that GREP ignores the repeat metacharacters.
Related Courses
-
InDesign Secrets
with David Blatner38h 45m Intermediate -
Learning Regular Expressions (2011)
with Kevin Skoglund5h 36m Intermediate
-
Introduction
-
Welcome1m 4s
-
-
1. GREP Basics
-
What is GREP?1m 53s
-
-
2. Basic Metacharacters
-
Escaping out metacharacters2m 49s
-
Building with wild cards9m 9s
-
Specifying locations7m 4s
-
3. Advanced Metacharacters
-
Creating "or" conditions5m 24s
-
Building subexpressions5m 52s
-
-
4. GREP Styles
-
Describing inconsistent text6m 59s
-
5. GREP Find/Change
-
Understanding queries8m 19s
-
Cleaning up text with GREP2m 45s
-
6. A Practical Project with Advanced Find/Change and GREP
-
Conclusion
-
Goodbye27s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Preserving and recalling using subexpressions