Skip to main content
deleted 1 character in body
Source Link
TheLearner
  • 433
  • 2
  • 8
  • 25

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 customb custom tags /b to apply a b bold to apply a /bb bold /b character style.

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

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?

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?

Source Link
TheLearner
  • 433
  • 2
  • 8
  • 25

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 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?