Questions tagged [grep]
A Unix command used to search files for the occurrence of a string of characters that matches a specified pattern.
104
questions
1
vote
1
answer
34
views
InDesign GREP code to add character styles to words in list separated by ;
I am trying to add grep to a paragraph style so that different character styles are automatically added to some list text that is separated by ; so that each item is a different colour. In the example ...
0
votes
2
answers
48
views
Indesign grep: Keep the two first words of a sentence together
How can I make sure that the two first words of any sentence are together on the same line. For example below, I want to have "To" and "make " automatically on the same line. I am ...
0
votes
0
answers
31
views
Change a paragraph style based on the paragraph style before it [duplicate]
In InDesign, I have H1, H2, and H3 styles that look fine when preceded and followed by my Body style. But in the instances where H1 is followed by H2, or H2 is followed by H3, there is too much white ...
1
vote
1
answer
57
views
Setting up a GREP find and proper nouns
I'm trying to set up a GREP which will find the proper nouns in my document and apply a character style to them which I will then use to preclude them from a spellcheck (I'm trying to avoid having to ...
0
votes
2
answers
63
views
Indesign Grep function to break email addresses on @ symbol
I'm trying to fit email addresses in a staff directory and wish to have the emails break on @ in order to have them look more consistent. I'm importing the email addresses via a data merge as well ...
0
votes
1
answer
115
views
GREP: selecting parts of the paragraphs enclosed by brackets
Please help me select the words within the small brackets, including the brackets themselves so that I can apply formatting to it. Here is a sample text: "This is an apple (red), and that is a ...
0
votes
0
answers
130
views
Indesign script to automate order list by last name
Every month I have to order a long list of names alphabetically by last name.
Is there a way to do this all in one single script?
This is what I am currently doing:
Use a GREP to place the last names ...
0
votes
1
answer
179
views
Set text to white automatically on dark spreads
I'm working on an illustrated book with artwork throughout. Every so often, I have a spread that has a dark background. I've created a Master page with headers and folios set in white but I can't see ...
0
votes
2
answers
374
views
InDesign GREP code for find words between a full stop (.) and a colon (:)
What is the GREP code for finding all words between a full stop (.) and a colon (:) and then selecting those words and the colon (but not the fullstop)? For example: '. Tone:' or '. Final result:') in ...
0
votes
1
answer
190
views
Indesign: Keep multiple paragraphs (of different styles) sets together
Is it possible with a script or GREP styles to keep together multiple sets of paragraphs which can contain 5-6 different paragraph styles though the start and end paragraph styles are always the same –...
0
votes
1
answer
118
views
Remove the round brackets and keep the text?
I have more than 1000 titles with round brackets. All have a paragraph style. I'm trying to keep the title\text but removing the brackets. I managed to find them in the GREP, but I could not find what ...
0
votes
3
answers
95
views
How do I use PositiveLookbehind to match multiple strings in GREP styles in Adobe Indesign?
I'm trying to format a keyword(s) that comes after specific string. For example, I want to bold the words, "happy", "sad", and "angry", but only if they are preceded by &...
2
votes
0
answers
37
views
Adding a title before several paragraphs of a certain paragraph style
In Indesign, I need to insert a fixed title (something like - "law") before each group of paragraphs of a certain paragraph style, and another title right after it (something like - "...
1
vote
1
answer
933
views
InDesign GREP that matches select characters between two strings
I am trying to typeset a dictionary, and at the end of many of the word entries, there are additional references the reader can consult.
...definition here.
For further reference, apple; fruit; tree
...
1
vote
2
answers
950
views
GREP Style Capital first letter
Is it possible to create a GREP function that will automatically change the first letter to capital letter in a word? For example: "moonlight" and GREP changes it to "Moonlight".
...
1
vote
1
answer
487
views
Indesign GREP - find lines before a string but exclude string
I am struggling to find some GREP to find lines before a string when I need to exclude the string itself from the selection.
In this example, I need to find the 2 lines before "Fox", but ...
0
votes
1
answer
344
views
GREP: Format PART of a paragraph in InDesign
I am trying to format a part of a paragraph (I have the paragraph style) with GREP.
It is the caption of some photos, and the phrases are divided by the sign of "|":
This is phrase 1 | This ...
1
vote
1
answer
334
views
InDesign: Regex/GREP works on tester, not in InDesign - issue with OR/| operator?
I have the following sample text:
Writing: Gnusto. Editing: Caskly. Circulation: Izyuk.
I'm trying to use a GREP regex to select only the job titles and colons (i.e. "Writing:", "...
0
votes
1
answer
394
views
Modify width of all text frames in a document
I have text frames on over 200 pages,
Is possible to select all text frames at once and decrease their width through Text Frame Options or any other method, as the edges of text frames are closely ...
0
votes
1
answer
210
views
Append avatar image to each paragraph in chat style book
I have more than 4000 messages, and I want to create a book for these messages in chat style
Look at this screenshot, it's just an example
Now, everything is ok, but I want to append an avatar image ...
0
votes
0
answers
45
views
Can fonts be displayed as contextual character combinations?
Looking for way to do a handwriting font but where certain letter sequences or patterns display together. Would the method be to put the two or three or four letters together as one, as uncommonly ...
2
votes
1
answer
331
views
Indesign GREP: Negative lookbehind with variable length
I use a complex .txt for the basic findchangebylist-script that is included in inDesign to fix some common typography mistakes. F.e. it changes the hyphen to an en dash and puts a thinspace between 3-...
0
votes
2
answers
763
views
How to use GREP to only style a part of the expression?
I like to use GREP in In-Design, the problem is I have a menu like so:
HAMBURGER Johnny's Favorite 3.50
I like Johnny's Favorite to be styled differently.
The first part, the dish, may contain ...
1
vote
1
answer
551
views
Indesign GREP: Find sentence until first occurence of specific character
the text I work with has marked each words or sentences that should be a marginalia with ##before and after##
as in:
Edi nos di occus aceaqui blam rerorent eumetur aut eaquid qui ut velibus quid ...
0
votes
1
answer
186
views
Using GREP with Merge in InDesign
I'm doing a data merge for a letter. In the data file there is a column for "title" (Mr., Mrs., Dr. etc.) So I set up my InDesign document with:<<title>> <<first>> &...
0
votes
1
answer
255
views
Writing GREP Wildcard Script for Illustrator without prompts
I found a script on here that adds percentage symbols to numbers in illustrator. It works great and I figured out way to auto populate the fields with the needed strings to run the code without having ...
0
votes
1
answer
907
views
Adding characters using Grep style in InDesign
2 problems about paragraph style...
can grep style do this?
Thanks!
1. if number is 10 duplicate four time / result: 10 101010
2. if number is 8 add 3 character like this "*" / result: 8 *...
1
vote
1
answer
1k
views
Grep: Search between "beginning of a paragraph" and colon :
I try to apply a style to a string of words that is beginning a paragraph and before a colon.
I prepared a first Grep search but it is not working (it is only placing the cursor before the colon ...
2
votes
2
answers
526
views
Indesign: GREP lookbehind
I'm trying to automatize giving character styles to the editor given names (not the author names) in literature sources like this one via Find/Change (not GREP styles):
Jacobs, G. A., Boero, J. V., ...
1
vote
1
answer
278
views
GREP: Change spaces for tabs in specific conditions
I want to know the way in InDesign with GREPs, if possible, to any paragraph that starts with numbers followed by a period and a space ("00" + [.] + [space]"), and replace the space for ...
2
votes
1
answer
122
views
How do I grep from the match closest to the end?
I have a sequence of titles and description in my text following a pattern similar to
Data A: foo; Data B: bar; Data C: baz; Data D: qux
I want to bold just the titles, so I wrote the following GREP ...
0
votes
0
answers
632
views
Use GREP in Indesign to replace PAIRS of typographer's (curly) quotation marks
Current format:
“This is a quoted speech, which said ‘another quoted speech’ is best.”
“However, what about their ‘discussion’s speech’?”
Intended format:
‘This is a quoted speech, which said “another ...
-1
votes
2
answers
998
views
GREP for non-breaking space after initials
I'm laying out a bibliography in ID, and I need a way to insert a non-breaking space after initials, so A., B., etc. don't end up at the end of lines.
Thanks in advance.
0
votes
0
answers
47
views
Find a string between 2 static element groups
I want to find all textblocks in InDesign with Grep that are between "Article: " and "— " I already tried to understand what they do here: https://indesignsecrets.com/findbetween-a-...
0
votes
1
answer
1k
views
Can I automatically apply a different paragraph style to all paragraphs beginning with a specific character style?
I'm laying out a very long encyclopedia which has lots of entries. The title of each article is inline with the first paragraph (each entry has multiple paragraphs), but does have a character style ...
1
vote
0
answers
325
views
Removing "space" in a data merge if not all names have titles to start with
I found a great reference on here for using Grep to remove a double space in a data merge if some names have a middle initial but others do not. But what do you do if the issue is at the start of the ...
1
vote
1
answer
187
views
How to search for the Nth (2nd, 3rd, etc.) white space in a paragraph?
How to search (via GREP) for the Nth (2nd, 3rd, etc.) white space in a paragraph in Adobe Indesign?
3
votes
0
answers
494
views
Adobe Indesign: How to look for the first line in each paragraph
How can I look for the first line in each paragraph, and add a line break after it?
0
votes
1
answer
698
views
Setup GREP Style to move numbers to next line InDesign
I'm working on typesetting a book in InDesign that has verses. Each verse starts with a number. The numbers can't be at the end of the line as it is the beginning of the text on the next line. I ...
1
vote
1
answer
354
views
GREP InDesign, can I move a word to the beginning of a paragraph?
Is there a way to move an entire specific word at the beginning of the sentence it belongs to? Let's say I want words contained within brackets to be repositioned.
At the moment I have something like ...
0
votes
1
answer
337
views
How to ignore word from global GREP style?
I asked this question to create a GREP style to make the 2 subscript when I typed H2.
I need the GREP to ignore the word H2Van.
I thought to amend the GREP to look for a space after the 2 as well ...
1
vote
1
answer
232
views
How to change the font of part of an expression with GREP?
I have the below expression and I want to just change the lowercase i to a different font and leave HMI as is. But I want to do this throughout the document no matter the text size or color.
0
votes
1
answer
178
views
InDesign GREP is not searching [any] styles
I'm troubleshooting one of my book designer's files and I can't seem to wrap my head around what's going on.
She reached out to me that her GREP was not picking up characters she was searching for, ...
4
votes
1
answer
275
views
Automatically convert H2 to H₂ when typing in Indesign?
I have to regularly type the word H2 into documents for my job. I always forget to make the 2 subscript
I've been watching David Blatner's Indesign secrets and I figured I could use either, commonly ...
2
votes
1
answer
490
views
InDesign, Grep - what is the base syntax of InDesign grep
There are many regex syntax, one different from the other: .Net regex, Java regex, PHP/PCRE regex, Python regex. etc.
Some sites for checking & testing regex expressions are just great - like ...
1
vote
1
answer
447
views
InDesign FindChangeByList Search for Text in a Style
Simple question:
What is the Javascript syntax for adding a Paragraph or Character Style to a search in the FindChangeByList.txt file?
As in: grep {findWhat:"Anything", findStyle"Bolder"}
Thank you....
0
votes
2
answers
766
views
InDesign CC GREP Help. Adding spaces around "+" (plus) symbol
Should be simple but it's not.
This GREP expression works in the FIND/CHANGE PANEL in InDesign CC:
However, when I plug it into a FindChangeList.txt, it doesn't work:
I know for a fact that the ...
2
votes
0
answers
213
views
Does someone know of a script to automatically put specific texts as footnote text?
A little while ago I made this post. Because of that I can automate placing footnote references where they are needed. Now the problem is that the actual footnote texts are just placed randomly in the ...
3
votes
1
answer
237
views
GREP style for three digit code NOT followed by specific characters
I'm trying to set up a GREP style that will style a 3 digit code (example 789) but not apply that style when the code is followed by the characters ct.
So the style would apply to the 100 in "100 ...
1
vote
2
answers
566
views
InDesign GREP, Single Character Underlining
I'm new to the concept of using GREP. I work on documents which contain Australian Indigenous terms which contain special characters, for example, Ayers Rock's Indigenous name is Uluru, whereby the r ...