Copy link to clipboard
Copied
Hi All, I've been trying to change colours of whole stand listings through GREP styles in InDesign for a exhibitor list but I'm getting an error that I can't get past. I've set up character styles to denote different colours depending on what the first letter of the "stand" is eg. TA = light blue, 2 = green, etc.
This is an example of a line:
<paragraph open>TAEKwondo <tab> 2F34; 3G29; EW8; TA19 TA20 TA21<end of paragraph>
This is the GREP style for TA that I have set up:
(?<=\t)*\<TA\w+\>
...but it's still applying to TAEKwondo even though I've got a positive lookbehind on a tab.
Am I close or way off?
Thank you in advance,
Thank you so much Eugene, but I've created something that works:
(?<=\t)*\<TA\w+\>
...which will find all instances that start with TA
Last GREP style in the sequence:
Apply Black character style:
(?<=^).+(?=\t)
To any character between the start of the paragraph and the start of the tab
Really appreciate your help,
Copy link to clipboard
Copied
The regular expression (?<=\t)*\<TA\w+\> would try to match a word that starts with "TA" and is preceded by a tab character. However, the use of the asterisk after the positive lookbehind assertion (?<=\t) is not valid and would likely result in an error or unexpected behavior.
You just need a different qualifier instead of a tab character
This works based on your sample which I put 3G29 inbetween TA to make sure it was working
Copy link to clipboard
Copied
\h represents any space character - nonbreaking, hair space, tab etc.
Copy link to clipboard
Copied
Thank you very much for your suggestion Eugene but that does not work because it does need to incorporate the option of having *only include items after the tab*
Copy link to clipboard
Copied
Copy link to clipboard
Copied
The reason why it doesn't work with the tab is because it's always going search in a logical order.
Text <Tab> Text
Why this does not work is because the qualifier is the tab - then it's looking directly after the tab for the number or the text which in the example below only illustrates 1 number as expected
A simpler approach would be to apply different paragraph styles
The only one with No Colour style applied is the bottom line of text which has no Tab character. You'd have to find the lines of text with a tab with a search. And apply the paragraph style.
Then the coloured style is done the same way
Copy link to clipboard
Copied
Thank you so much Eugene, but I've created something that works:
(?<=\t)*\<TA\w+\>
...which will find all instances that start with TA
Last GREP style in the sequence:
Apply Black character style:
(?<=^).+(?=\t)
To any character between the start of the paragraph and the start of the tab
Really appreciate your help,
Copy link to clipboard
Copied
I've a sneaking suspicion this shouldn't be working the way you have it - and it might affect the document if InDesign is updated... it's a bit peculiar but hey if it works.