New Feature: Playlist Center! Pick a topic and let our playlists guide the way.

Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Using GREP styles (regular expressions)

From: InDesign Typography

Video: Using GREP styles (regular expressions)

We have seen how Nested Styles depend upon consistency in the formatting in order to work, so what if there isn't an identifiable consistency to the text that you want to apply specific formatting to. In this scenario let's imagine that we're formatting some TV listings and every time there's a Film is shown, we want to word FILM to be code out in red, but the position of that word within the paragraph is going to vary. But we're never going to able be say it occurs specifically at this point in the paragraph every time. It's always going to vary. So for this we need a GREP style.

Using GREP styles (regular expressions)

We have seen how Nested Styles depend upon consistency in the formatting in order to work, so what if there isn't an identifiable consistency to the text that you want to apply specific formatting to. In this scenario let's imagine that we're formatting some TV listings and every time there's a Film is shown, we want to word FILM to be code out in red, but the position of that word within the paragraph is going to vary. But we're never going to able be say it occurs specifically at this point in the paragraph every time. It's always going to vary. So for this we need a GREP style.

Just as a prelude to that, I'm going to setup this as a repeating style. So starting out with the Paragraph Formats, I'll keep Myriad Pro, and then we'll come and choose New Paragraph Style, and we'll call it tv_ns. So Drop Caps and Nested Styles, I'd like the time of each of the programs to be code in bold so I'm going to say New Nested Style, and I'll make a new one, New Character Style.

I'll call this bold, Basic Character Formats, and I won't include the Font Family, but I'll include the Font Style. Click OK, and there we see what's happening. Bold is now being applied through 1 Word. I should say at this point that if there were a space between the 6.00 and the am, this wouldn't work. So I'm deliberately making sure that my formatting does not include spaces between the numerals and the am or pm. All right! Next, New Nested Style, None, through 1 Word isn't going to work, because Saturday Kitchen that's two words.

Football focus is two words, The Politics Show, three words. So we need a different approach here. What consistent is that we want to bold styling to turn back on again when we get to a digit. So I'm going to say None, in this case I don't want through because that word apply to the first digit itself, I want to say up to 1 Digit, and then I say New Nested Style, and I Repeat the last 2 styles. When we click OK that's what we get.

You can already probably spot a potential flow in this cunning plan of mine, and that is that if you had a numeral in any of the names of the shows, then the whole thing would fall apart, and it has to be said that Nested Styles are sometimes rather fragile. But in this particular case it is going to work. But we need to get that word FILM called out in a color. So for this, I could have done it all at the same time, but I just wanted you to see where we're at before we go and add this next bit, the GREP Style.

So GREP stands for General Record Expression Parser, which tells you actually nothing about what it does, but that's what it stand for. What it's useful for is being able to apply a specific character style to some pattern in your text, and this is the simplest application of a GREP Style because the pattern is the word FILM. GREP Styles are very useful. Let's say that you always want your company name to be called out in a specific font, specific color, specific size, then you can use a GREP Style.

So I'm going to say GREP Style > Apply, what are we applying? Well, I'm going apply this one here that's already set up, but of course you can create it on the fly, and I'm going to apply that. And what I'm applying it to? I'm applying it to the word FILM. Now it is case sensitive, so I'm tying it in the way I have typed it on the page. Click OK, problem solved. Now no matter where the word FILM occurs in this paragraph, it's automatically going to be called out in that particular character styling.

That is a GREP Style applied in this particular instance alongside a Nested Style.

Show transcript

This video is part of

Image for InDesign Typography
InDesign Typography

107 video lessons · 19393 viewers

Nigel French
Author

 
Expand all | Collapse all
  1. 4m 4s
    1. Welcome
      55s
    2. Using the exercise files
      51s
    3. Customizing the workspace for type
      2m 18s
  2. 55m 41s
    1. Working with text frames
      8m 26s
    2. Using a primary text frame (CS6 only)
      3m 59s
    3. Understanding text flow methods
      6m 25s
    4. Understanding text threads
      3m 40s
    5. Understanding Smart Text Reflow
      2m 27s
    6. Mocking up pages with placeholder text
      5m 47s
    7. Placing multiple text files
      3m 50s
    8. Using Auto-Size text frames (CS6 only)
      4m 1s
    9. Copying and pasting vs. placing
      2m 25s
    10. Cleaning up text with Find/Change
      5m 46s
    11. Using the Story Editor
      3m 41s
    12. Spanning columns
      5m 14s
  3. 45m 50s
    1. Choosing your type
      6m 46s
    2. Understanding text essentials
      6m 37s
    3. Scaling type
      2m 27s
    4. Using italic and oblique type
      4m 33s
    5. Working with condensed and extended type
      4m 26s
    6. Setting type in all caps
      3m 46s
    7. Setting type in small caps
      4m 21s
    8. Underlining type
      4m 11s
    9. Using superscript and subscript
      4m 35s
    10. Applying baseline shift
      4m 8s
  4. 16m 6s
    1. Understanding type anatomy
      3m 25s
    2. Exploring serif and sans serif
      2m 48s
    3. Comparing points, picas, and ems
      8m 34s
    4. What's in a name?
      1m 19s
  5. 16m 27s
    1. Setting leading
      4m 56s
    2. Avoiding auto-leading
      4m 12s
    3. Leading shortcuts and preferences
      4m 7s
    4. Using autoleading with inline graphics
      3m 12s
  6. 21m 25s
    1. Defining kerning and tracking
      2m 5s
    2. Understanding kerning methods
      5m 10s
    3. When and how to kern
      5m 53s
    4. When and how to track
      8m 17s
  7. 45m 48s
    1. Working with quotes, primes, and apostrophes
      8m 16s
    2. Using dashes
      5m 24s
    3. Using ellipses
      2m 56s
    4. Working with accents and special characters
      4m 1s
    5. Using space characters
      4m 15s
    6. Working with ligatures
      4m 29s
    7. Setting fractions
      3m 56s
    8. Using lining and proportional numerals
      2m 49s
    9. Using alternates, swashes, and ornaments
      5m 2s
    10. Working with optical sizes
      4m 40s
  8. 57m 20s
    1. Understanding alignment
      3m 47s
    2. Working with left-aligned type
      3m 24s
    3. Working with justified type
      7m 5s
    4. Using Optical Margin Alignment
      3m 39s
    5. Determining column width
      4m 53s
    6. Working with center alignment
      5m 36s
    7. Working with right alignment
      1m 22s
    8. Aligning to or away from the spine
      1m 50s
    9. Understanding the Paragraph Composer and Single-line Composer
      3m 44s
    10. Combining alignments
      9m 20s
    11. Using hanging punctuation
      2m 13s
    12. Working with vertical alignment
      10m 27s
  9. 14m 9s
    1. Using first-line indents
      2m 26s
    2. Using indent alternatives
      2m 3s
    3. Working with left and right indents
      4m 0s
    4. Using last-line indents and outdents
      1m 26s
    5. Using paragraph spacing
      4m 14s
  10. 23m 19s
    1. Setting hyphenation
      6m 14s
    2. Working with line breaks and discretionary hyphens
      4m 48s
    3. Balancing ragged lines
      1m 36s
    4. Using the No Break feature and non-breaking characters
      2m 52s
    5. Using frame, column, and page breaks
      3m 42s
    6. Defining Keep Options
      4m 7s
  11. 37m 53s
    1. Understanding tabs
      8m 58s
    2. Considerations for table text
      3m 55s
    3. Table tips and tricks
      11m 55s
    4. Creating a bulleted list
      6m 50s
    5. Creating a numbered list
      3m 46s
    6. Creating a multi-level numbered list
      2m 29s
  12. 23m 12s
    1. Understanding drop caps
      11m 3s
    2. Navigating tricky drop caps
      5m 14s
    3. Using a nested character style with a drop cap
      3m 59s
    4. Other uses of drop caps
      2m 56s
  13. 1h 11m
    1. Understanding paragraph and character styles
      7m 13s
    2. Creating, applying, and editing styles
      7m 3s
    3. Removing overrides
      4m 58s
    4. Creating and applying character styles
      5m 4s
    5. Creating and applying nested styles
      12m 30s
    6. Using GREP styles (regular expressions)
      4m 8s
    7. Creating and applying sequential styles
      6m 19s
    8. Using paragraph rules creatively
      11m 48s
    9. Mapping Word styles
      6m 12s
    10. Working with anchored objects and object styles
      6m 24s
  14. 25m 30s
    1. Applying a text wrap
      6m 7s
    2. Making items ignore a text wrap
      1m 46s
    3. Using text wraps for flexible layouts
      3m 2s
    4. Working with difficult text wraps
      8m 39s
    5. Inverting text wraps
      2m 7s
    6. Setting text wrap preferences
      3m 49s
  15. 29m 33s
    1. Choosing a page size and setting margins
      6m 33s
    2. Setting up columns
      2m 53s
    3. Dividing a page into rows
      3m 27s
    4. Setting up a baseline grid
      5m 40s
    5. Handling baseline grid problems
      3m 37s
    6. Baseline grid tricks
      7m 23s
  16. 12m 19s
    1. Looking at screen documents
      4m 2s
    2. Setting size, leading, and line length onscreen
      3m 13s
    3. Exploring typefaces designed for the screen
      3m 36s
    4. Accessibility: Contrast and color
      1m 28s
  17. 28s
    1. Goodbye
      28s

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold

Are you sure you want to delete this note?

No

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.