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

Is there a way to add a space where there is none with Grep?

Explorer ,
Feb 02, 2017 Feb 02, 2017

Copy link to clipboard

Copied

The title says it all

Views

656

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 , Feb 02, 2017 Feb 02, 2017

That is easy:

(\d)(.?)

and change to $1 $2

Note there is a space between $1 and $2

Votes

Translate

Translate
Enthusiast ,
Feb 02, 2017 Feb 02, 2017

Copy link to clipboard

Copied

If the space fits in text that you can find a pattern for and write an expression for, yes. You'll have to use the Find/Change dialog box for that, since you can't add a space using GREP styles.

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
Explorer ,
Feb 02, 2017 Feb 02, 2017

Copy link to clipboard

Copied

I know I'm doing it with find/change and there is a pattern. The problem is I'm not finding a rule to select the space, positive look behind and lookahead don't change anything they change whatever is after or before but there is nothing not even a space.

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 ,
Feb 02, 2017 Feb 02, 2017

Copy link to clipboard

Copied

Are you trying to add a space to the text somewhere? In the Change To field you would just put a space. It's hard to figure out exactly what you need without samples (of what you have and of what you need). I have a hard enough time sometimes WITH samples haha! Maybe if you post samples we can figure it out for you.

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
Explorer ,
Feb 02, 2017 Feb 02, 2017

Copy link to clipboard

Copied

It's just a regular text:

This Is what I have

1some text and 2some text and 3some text   etc,

I just want to add some space between the numbers and the words

But I can't select the "space" so I don't know how to do it

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 ,
Feb 02, 2017 Feb 02, 2017

Copy link to clipboard

Copied

That is easy:

(\d)(.?)

and change to $1 $2

Note there is a space between $1 and $2

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 ,
Feb 02, 2017 Feb 02, 2017

Copy link to clipboard

Copied

And you actually don't even need the question mark in the Find What. I had put it a "+" at first which then necessitated I put in the "?".

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
Explorer ,
Feb 02, 2017 Feb 02, 2017

Copy link to clipboard

Copied

Thanks so much! but what are those change signs?

$=end of paragraph?

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 ,
Feb 02, 2017 Feb 02, 2017

Copy link to clipboard

Copied

No, in the Change To field they stand for "found text." So, I broke the search into two groups: Group 1 is the number (\d) and Group 2 is the character that follows the number (.). Saying to change to $1 means everything that Group 1 found, then I followed with the space you want to add (I used a spacebar space, you could always put in a thin space or whatever you need), followed by $2 for the text found in group two (the following character).

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
Explorer ,
Feb 02, 2017 Feb 02, 2017

Copy link to clipboard

Copied

Thanks a lot

I'm actually new to indesign I learned it with a course you gave at creative live! (I'm assuming your the real Erica Gamet   )

I realize now it had a simple answer, and I thought it was a difficult question! I just had to learn about found!

Thanks!

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 ,
Feb 02, 2017 Feb 02, 2017

Copy link to clipboard

Copied

I am, in fact, "THE" Erica Gamet...haha! Glad you liked my course. I also have a YouTube channel with a GREP playlist: youtube.com/ericagamet if you want to see a bit more. Hoping to get more videos going again in the next couple of weeks. This video deals with groups like your issue: GREP in InDesign: Grouping and Manipulating Found Text - YouTube

Good luck and have fun with GREP!

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
Advocate ,
Feb 03, 2017 Feb 03, 2017

Copy link to clipboard

Copied

LATEST

You could also do it dynamicly in your paragraph-style. And enhance your GREP as you encounter new examples.

So, for example, I dont want 140x200cm and 500g be stuck together, so I housed a
\d(?=%|g)

into my paragraph. The applied style only has a spacing between.

Bildschirmfoto 2017-02-03 um 15.09.49.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