Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 87055

Grep to style second occurrence of a word

$
0
0

Hi All,

 

I am currently setting a dictionary for children.

 

bicycle noun

a vehicle with two wheels in tandem, usually propelled by pedals connected to the rear wheel by a chain, and having handlebars for steering and a saddlelike seat. • Some find it quicker to ride a bicycle  and weave through the cars than to take the bus or drive a private vehicle.

 

I managed to match from the first occurrence of bicycle to the second (underlined section below) by using the following grep.

(?:^(\w+).+\r.+(\r.+)?)(\1)

 

bicycle noun

a vehicle with two wheels in tandem, usually propelled by pedals connected to the rear wheel by a chain, and having handlebars for steering and a saddlelike seat. • Some find it quicker to ride a bicycle  and weave through the cars than to take the bus or drive a private vehicle.

 

This grep (as is) is working as expected across all the dictionary but now I need to be able to select only the second word (italicized and in red in the example above) to be able to give it the correct character style.

 

Any assistance would be greatly appreciated.

 

Many thanks in advance.

Stephen


Viewing all articles
Browse latest Browse all 87055

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>