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

ID GREP question: non/marking subexpressions?

Community Expert ,
Jul 19, 2024 Jul 19, 2024

Copy link to clipboard

Copied

Okay, since we're having so much fun with GREP this week —

 

Can anyone from @Peter Kahrel on down explain what "Marking Subexpression" — ( ) — and "Non-Marking Subexpression" – (?: ) — are/do? I can't find a word about them in any search of the Adobe help, or Google, or any general GREP reference.

 

The first, as just "subexpression," is somewhere in the "duh" category, as grouping elements with parentheses is a basic GREP element. The second makes no sense, really. And giving both drop-down call elements seems... pointless.

 

These look very much like ancient, outdated elements that have persisted from sheer inertia, the kind of stuff that drives me crazy when I update ancient holy texts in various fields.


┋┊ InDesign to Kindle (& EPUB): A Professional Guide, v3.1 ┊ (Amazon) ┊┋
TOPICS
How to

Views

223

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

Community Expert , Jul 19, 2024 Jul 19, 2024

A marking subexpression is one that InDesign creates a referent for, so that you can later refer to it using $1 (to $9).

 

There are occasions where you just want to group a subexpression but you don't need a reference. In that case you do a non-marking subexpression (?: . . .). Creating a reference is (relatively) expensive, so using a non-marking subexpression whenever you can makes the Grep expression more efficient -- at the cost of readability,.

 

So in fact you can happily live without eve

...

Votes

Translate

Translate
Community Expert ,
Jul 19, 2024 Jul 19, 2024

Copy link to clipboard

Copied

A marking subexpression is one that InDesign creates a referent for, so that you can later refer to it using $1 (to $9).

 

There are occasions where you just want to group a subexpression but you don't need a reference. In that case you do a non-marking subexpression (?: . . .). Creating a reference is (relatively) expensive, so using a non-marking subexpression whenever you can makes the Grep expression more efficient -- at the cost of readability,.

 

So in fact you can happily live without ever using any non-marking subexpressions. It's just a device to make Grep more efficient. Mind you, this goes back a long time when processors were slower and memory much smaller, and with modern computers most of the time you'll probably not see much difference -- if any.

 

P.

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 ,
Jul 19, 2024 Jul 19, 2024

Copy link to clipboard

Copied

Thanks!

 

One of the aggravating things about topics like this (mostly, but not entirely in programming) is so much legacy baggage  — it never quite becomes outdated enough to ignore, but it's not of much use to some majority of users.


┋┊ InDesign to Kindle (& EPUB): A Professional Guide, v3.1 ┊ (Amazon) ┊┋

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 ,
Jul 19, 2024 Jul 19, 2024

Copy link to clipboard

Copied

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 ,
Jul 19, 2024 Jul 19, 2024

Copy link to clipboard

Copied

Well, yes, but it doesn't use any correlated search phrase. You sort of have to know what you're searching for to expand the search to find it.

 

I could not get from "marking subexpression" to any useful topic. So on top of everything else, we have different tribes' patois to cope with. 🙂


┋┊ InDesign to Kindle (& EPUB): A Professional Guide, v3.1 ┊ (Amazon) ┊┋

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 ,
Jul 19, 2024 Jul 19, 2024

Copy link to clipboard

Copied

Mwen pa ka palé Patwa!

Mike Witherell

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 ,
Jul 19, 2024 Jul 19, 2024

Copy link to clipboard

Copied

LATEST

😄

 

I've just sat in too many meetings with programmer/developers who came up different ladders, subtly or not-so-subtly insisting on their (tribe's) terms and phrases. The migraine ones were where some hard case would ask, "What's a _____?" every single time the other term was used.

 

I don't do code meetings any more.


┋┊ InDesign to Kindle (& EPUB): A Professional Guide, v3.1 ┊ (Amazon) ┊┋

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