0

I need to find several text-elements that have a structure like

 — 12345

or

 — 123456

or

 — 1234567

in InDesign via GREP - I can't display that in stackoverflow, but each of these terms is followed by a ¶. Could somebody help me finding the right search-term or generally does anybody know some sort of "generator" for those GREP-searches?

  • 2
    So followed by end of paragraph or end of paragraph character? – joojaa May 4 '18 at 9:49
  • — 1234567¶ would be the correct term – Daiaiai May 4 '18 at 9:52
  • @Vinny Please do not answer in the comments; see for example rpg.meta.stackexchange.com/questions/6533/… – Luciano May 4 '18 at 12:09
  • 1
    @Luciano Maybe you're right, but I'm usually reluctant to answer when the lack of information prevents an accurate answer. – Vinny May 4 '18 at 12:36
  • @Vinny Write one based on what's in the question, or don't write it at all. Chances are: either OP comes back to clarify and gets a proper answer later, or doesn't and your comment is enough, in which case the question stays open forever since there's no accepted answer. Comments should be for requesting clarification and commenting, that's all. – Luciano May 4 '18 at 12:55
3

Your question is somewhat unclear but you could do the following in InDesign with GREP:

 — 12345

try: ^ — \d{5}

 — 123456

try: ^ — \d{6}

 — 1234567

If you're looking for a range from 12345 to 1234567 try ^ — \d{5,7}. Based on what you left in the comment for:

— 1234567¶

you could use — \d{5,7}¶ or — \d{5,7}$. If you want to find anything after the dash that is numerical you can also do — \d+$. The usage of ^ indicated beginning of line so if these are in between text omit ^.

If you wanted to reuse the numbers for any reason just surround the digit with () for example:

— 12345

try: — (\d{5,7})

A good reference for GREP in InDesign:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.