Mobile app version of vmapp.org
Login or Join
Cooney243

: Regex to convert custom tags InDesign GREP Consider the following text: This is a test text with b custom tags /b to apply a b bold /b character style. In the above text, I have used

@Cooney243

Posted in: #AdobeIndesign #CharacterStyles #IndesignScripting

Consider the following text:


This is a test text with b custom tags /b to apply a b bold /b character style.


In the above text, I have used b and /b as custom tags to designate a section I need to be in bold. I am trying to write a GREP expression into the paragraph style that will change the above text into the below, on the fly:


This is a test text with custom tags to apply a bold character style.


The regex I am using is:


( b .+? /b )


This works only partially. What it renders looks like this:


This is a test text with b custom tags /b to apply a b bold /b character style.


Can someone please help me correct the expression? How can I make the tags (b and /b) disappear?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Cooney243

1 Comments

Sorted by latest first Latest Oldest Best

 

@Candy945

Create two character styles. One for Bold, one for invisible.
in the invisible, go to advanced character formats, change text size to 1pt and horizontal scale to 1, this effectively makes the character so small it wont print or show.

now create a paragraph style, using GREP styles tab
create a GREP to find the bold text, apply bold style.
create a GREP to find the custom tags, apply invisible style

problem solved ;)

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme