Copy link to clipboard
Copied
Is it possible replace character with grep style in paragraph style?
Copy link to clipboard
Copied
Could you explain better and give us an example of exactly what you would like to do?
Copy link to clipboard
Copied
Like comma (,) to forced line break.
Copy link to clipboard
Copied
Maybe I didn't understand good the question.
Do you want replace comma with line break in one paragraph style?
You can do it with find - change
find:
,
format: your paragraph style
change:
^n (forced line break)
Copy link to clipboard
Copied
Hi,
you cannot replace a character with another one using GREP Styles.
You'd just format a character using a GREP expression with a character style.
So, no it's not possible to do what you like to do.
But you could do a find/replace action with your text using a GREP pattern.
Last resort:
Maybe you are able to create a character style where the comma is formatted with 1000% width and with a larger point size and no fill and stroke. Depending on the width of your text line this could work like that:
Download the IDML for this little experiment from my Dropbox account:
Dropbox - CommaBreaksTheLine-GREPStyle-CS6.idml
Regards,
Uwe
Copy link to clipboard
Copied
It must be noted that this is most emphatically not what GREP styles are designed to do!
See also the online help: Drop caps and nested styles in InDesign (which literally answers the OP's question in the first paragraph under "Create GREP styles").
It comes close to "automatically fixing typos" such as double spaces, by setting the size of more than 1 consecutive space to 0.1pt, or capitalizing every word in titles. Personally, I frown upon such solutions because they appear to change the actual text – but it is not changed. When will this bite you back? Well, I had employed an automatic Title-Case for all subheadings in a large book, only to find out later that I also needed to create bookmarks for all of those headings - and bookmarks don't "see" the All Caps formatting that I used.
Pretty awesome thinking-out-of-the-box though I can't think of a practical downside other than the above.
Copy link to clipboard
Copied
Maybe it's safer and easier to use a script to make this replacements...
Based on the grep, of course.
Copy link to clipboard
Copied
Let's see what our OP is saying now that two solutions are on the table…
FWIW: it's not clear at all how the text is structured.
Maybe a screenshot by the OP could help showing the text with hidden characters visible.
Regards,
Uwe