Copy link to clipboard
Copied
I'm using the following GREP expression to change character styles between to Parenthesis within Paragraph Style Options:
(?<=\().*?(?=\))
Problem is, when I create a GREP style in the paragraph style, it doesn't change the style. But if I do a GREP search and replace, it works as intended, so the code is not the issue.
Anyone know how to fix this?
(New) Balm when you buy 2 (Old Beauty) products.
to
(New) Balm when you buy 2 (Old Beauty) products.
Piece of cake
Via grep styles, apply "Invisible" character style using [()] regex.
My recipe for "invisibility":
size: 0.1pt
tracking: -1000
vertical and horizontal scaling: 1%
color: [none]
Copy link to clipboard
Copied
Hi
I would start by checking there's no character style (with "Regular" style) applied to the text.
(Character styles has priority over grep styles.)
Copy link to clipboard
Copied
I agree with @vinny38 -- I just tested with CC2018 and it works as intended.
Only if you are 100% sure it should have worked (*), then maybe it's related to the CC2019 bug GREP search fails to find all the matching instances in long InDesign documents​. If you are using CC2019 and did not manually install this bug fix, you could try this.
(*) I.e., you are sure you are looking at the right document, have no silly typos in the GREP, you are looking at the correct character style name, et cetera et cetera. No offense meant, but very, very often, such "it does not work!" complaints are due to human error ...
Copy link to clipboard
Copied
Game: Here, there's no char style already applied but the grep style doesn't work! …
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Je n'aurai même pas osé ! … Vincent, t'as vraiment l'esprit tordu!
Donc le style de caractère est correct ! …
Copy link to clipboard
Copied
T'as pas montré la fenêtre d'options de style de paragraphe en entier...
Copy link to clipboard
Copied
… Le problème ici, c'est le style Grep ! [pas de piège ailleurs !]
Copy link to clipboard
Copied
OK man... got it.
(Thanks to your last screenshot where the standalone square bracket caught my eye.)
Obviously there was one (or more) invisible characters at the end of the regex that would make it fail.
The moral of this story: let's be careful when copying/pasting Grep code from a forum
The notepad answer:
Thanks for this fun game mon ami !
Copy link to clipboard
Copied
À une prochaine fois ! …
Copy link to clipboard
Copied
Hi Vinny,
maybe it would help if one always is using the Advanced Editor option of the forum and do syntax highlighting a GREP pattern with
Insert >> Syntax Highlighting > Plain
(?<=\().*?(?=\))
Regards,
Uwe
Copy link to clipboard
Copied
Yep your both right many thanks, it was a character style.
So for my next trick I'm going to try and delete or change the character style of Parenthesis so they disappear or at least hidden using a white very small point size within the character style. Would this be possible?
As a background of what I am trying to do I am automating artwork to be created from data (excel file) so the Parenthesis are a way to indicate bold type within the spreadsheet which intern will populate on the Artwork.
(New) Balm when you buy 2 (Old Beauty) products.
to
(New) Balm when you buy 2 (Old Beauty) products.
to
New Balm when you buy 2 Old Beauty products.
Copy link to clipboard
Copied
Piece of cake
Via grep styles, apply "Invisible" character style using [()] regex.
My recipe for "invisibility":
size: 0.1pt
tracking: -1000
vertical and horizontal scaling: 1%
color: [none]
Copy link to clipboard
Copied
Absolutely nailed it guys.
Thank-you ( Merci ) very much, really appreciate you time and Knowledge.
Cheers