Copy link to clipboard
Copied
I am a beginner while using GREP in InDesign I have nearly 300 questions listed in one document. The questions begin with Q and the question number like
Q.32 Name the building.....
Q.33 Regional planning developer.........
Now I want to add more space after every space that starts before the word of the question . So
Q.32 Name the building.....
will become
Q.32 Name the building.....
What is the search string in GREP find and replace box so that The GREP should find ONLY the first space that occurs in a paragraph before an alphabet. That particular paragraph must start with the letter Q
or
The GREP can find the first space that occurs in a paragraph after Q.xxx
xxx is digits at maximum of three.
one solution could be:
find:
^Q\.\d{1,3}\K\x{20}
replace:
replace with space which you want
https://forums.adobe.com/people/vladan+saveljic wrote
one solution could be:
find:
^Q\.\d{1,3}\K\x{20}
replace:
replace with space which you want
Wow!! Thanks a lot!
Can you provide a detailed description please that tells the breakdown portion of each part?
^Q means Q at the starting of every paragraph. What about others?
Copy link to clipboard
Copied
one solution could be:
find:
^Q\.\d{1,3}\K\x{20}
replace:
replace with space which you want
Copy link to clipboard
Copied
https://forums.adobe.com/people/vladan+saveljic wrote
one solution could be:
find:
^Q\.\d{1,3}\K\x{20}
replace:
replace with space which you want
Wow!! Thanks a lot!
Can you provide a detailed description please that tells the breakdown portion of each part?
^Q means Q at the starting of every paragraph. What about others?
Copy link to clipboard
Copied
\. full stop
\d any digit
{1,3} min 1, max 3
\K lookbehind
\x{20} any space
Copy link to clipboard
Copied
https://forums.adobe.com/people/vladan+saveljic wrote
\. full stop
\d any digit
{1,3} min 1, max 3
\K lookbehind
\x{20} any space
Thanks.
Okay I just explored, \K is a new addition to InDesign intead of traditional lookbehind.
Moreover, are there two wildcards for space viz. x and s?
Another query. What about the figure of 20 inside the small bracket? How did you calculate the 20?
Copy link to clipboard
Copied
\x{20} or \x{0020} is unicode character
\s is any white space that include also tabs and paragraph brakes
Copy link to clipboard
Copied
\x{20} or \x{0020} is unicode character
You may enter as many zeroes before 20 as you like, they do nothing. I mean, \x{0000000020} will do exactly the same: will pick up all *regular* spaces (the ones you get by hitting a space bar), and will ignore all other flavors. Em, En, Hair, Thin, Punctuation, Figure, Flush spaces, you name it…
Sometimes it's for good, sometimes not. Sometimes you want to use \x{20}, \h, or \v, or something else, sometimes one-for-all \s is just ok. It depends.
Copy link to clipboard
Copied
https://forums.adobe.com/people/vladan+saveljic wrote
\x{20} or \x{0020} is unicode character
\s is any white space that include also tabs and paragraph brakes
Okay, I am getting little confused with x{0020}, or x{20}. The small brackets are a part of InDesign GREP lingo? I searched for the unicode equivalent here.
http://www.codetable.net/hex/20
It says  .
Copy link to clipboard
Copied
arjun2 wrote
… Okay I just explored, \K is a new addition to InDesign …
FWIW: \K was introduced with InDesign CS6, I think.
Regards,
Uwe
Copy link to clipboard
Copied
You didn't use a numbered list ??
Copy link to clipboard
Copied
vinny38 wrote
You didn't use a numbered list ??
No.