Two of the most potentially confusing options among the Repeat metacharacters…are Zero or One Time and Zero or More Times.…Why would you want to search for, or define, something zero times?…How can something that's not there be found?…The simplest answer is that these particular Repeat metacharacters allow you to…search for something that may or may not actually be present in your text.…Let's take a look at how these work, using GREP styles.…In this text, I make several references to various versions of Adobe InDesign,…from CS through CS3, and let's say I want to highlight all of those instances of…the product name with a specific Character Style.…
With my cursor in this text, I will open the Paragraph Styles panel and this…text is using the Body Copy style, so I will right-click on that and choose Edit…"Body Copy", go to GREP style and I'm going to create a new GREP style that…applies a style in this document called Red, which does only one thing.…It turns the text red.…And, of course, I have my default here To Text.…
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: Finding content that doesn't exist with zero functions