• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Basic GREP Question

Contributor ,
Aug 22, 2017 Aug 22, 2017

Copy link to clipboard

Copied

Hi there, I'm new to InDesign. I am trying to apply a No Break style to this:

Screen Shot 2017-08-23 at 12.29.26 AM.png

The (see figure19) should be on the same line. Also (see table...) should also be the same. How do I use GREP for such case?

Here's the skeleton I'm basing with:

Screen Shot 2017-08-23 at 12.38.06 AM.png

Views

420

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Aug 22, 2017 Aug 22, 2017

Try this instead (and you might want to also include the parenthesis, though they should travel with the text just fine).

see (figure|table) \d+

Votes

Translate

Translate
Enthusiast ,
Aug 22, 2017 Aug 22, 2017

Copy link to clipboard

Copied

You need the pipe symbol between your words in the brackets, not a slash.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Aug 22, 2017 Aug 22, 2017

Copy link to clipboard

Copied

Hi thank you Erica that was an oversight. Using pipe symbol instead of slash still would not work. Please advise.

Screen Shot 2017-08-23 at 12.42.39 AM.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 22, 2017 Aug 22, 2017

Copy link to clipboard

Copied

See my other reply...I answered too quickly...you need ( ) around your phrases...and also the space before the digits.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 22, 2017 Aug 22, 2017

Copy link to clipboard

Copied

Try this instead (and you might want to also include the parenthesis, though they should travel with the text just fine).

see (figure|table) \d+

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Aug 22, 2017 Aug 22, 2017

Copy link to clipboard

Copied

Thank you very much Erica. That worked as intended. Much appreciated!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 22, 2017 Aug 22, 2017

Copy link to clipboard

Copied

A couple of problems in your GREP, but still easy to fix.

First off: [square brackets] are to create an allowed set of matches for a single character. For instance, [0123] will match a single '0', '1', '2', or '3'. So, your [figure\table] will match one of these character only. Use round brackets to create "full word" matches.

Second, the backslash before the 't' forms an escape code! This matches not '\' nor 't', but a Tab character. Your expression matches a single tab, or 'a', 'b', 'e', 'f' and a few more. You probably want the OR bar |  here.

Third: you forgot the space after "figure/table".

All together , this should work:

see (figure|table) \d+

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Aug 22, 2017 Aug 22, 2017

Copy link to clipboard

Copied

LATEST

Thank you Jongware, that worked as intended! And thank you for your valuable knowledge. I still need to learn a lot! Thanks again

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines