Copy link to clipboard
Copied
Hi folks. I have what I imagine is a very simple GREP query. All of the products in my catalogue have a 'Delivered to you from ...' date which appears at the end of the text. I'd like it to appear in the bold character style but the text after that varies according to the date, so I'd just like it to continue until it gets to the full-stop ideally (or end of paragraph). When I use 'end of paragraph' within the GREP option after the text it cancels out all of the bold text.
Bonus points if you can help me make the 'grows to ...' text a different style (this appears immediately before the delivery date. 🙂
Thank you very much.
I solved the problem by dragging the “italic body” character style at the top of the GREP style list. I am not sure why it works now…
Copy link to clipboard
Copied
Try if the following works for you
Delivered to you from .*[.\r]
And for Grows to do we need to find it anywhere or just before Delivered to? And also is the search to be terminated at a full stop for this?
-Manan
Copy link to clipboard
Copied
Thank you... 'Grows to...' will always preceed 'Delivered to you from...' as per the example and yes the two are separated by a full stop. Thanks.
Copy link to clipboard
Copied
Try the following
(grows to .*?)\.\s*(?=Delivered to you from)
-Manan
Copy link to clipboard
Copied
Hmm... this one doesn't work. Note there is not always a 'delivered from' line after the growing size. Sometimes 'Grows to ...' is the last sentence, but it will always be structured the same - 'Grows to (variable).'
Copy link to clipboard
Copied
Ahh, so in the previous post you mentioned that it will always preceed delivered from so my expression does need delivered from to be present. Try the one shared by @jmlevy that should work.
-Manan
Copy link to clipboard
Copied
I got it to change to a particular character style (italics), but the following character style also appears in italics even though it shouldn't. Here's what I'm trying to get:
Grows to xxcm. Delivered to you from xx.
Here's what I'm getting, even though the second character style is not set to be italicised:
Grows to xxcm. Delivered to you from xx.
Copy link to clipboard
Copied
This works for me:
Copy link to clipboard
Copied
Thanks... still not working quite right for me. If you see my example 'Grows to' is a different style to 'Delivered to you from'. I can get them both to work but 'Delivered to' is appearing in bold italics, like it's continuing the italics from the 'Grows to', even though the style doesn't say italics.
Copy link to clipboard
Copied
Just to be sure to understand: you want to have “Grows to xxx.” in italics, including the period, right?
Can you post screenshots of your query? And a screenshot of your text, showing hidden characters?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
I am not an expert enough to understand why you use .*[.\r]
But the querys I use work, see below.
Copy link to clipboard
Copied
Hmm I have copied your suggestion but still have the problem. Maybe it is because I am using skew as the font doesn't have an italic variant. My bold style is set to 0% skew and italic style to 10%.
Copy link to clipboard
Copied
Can you share a sample of your file?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
I solved the problem by dragging the “italic body” character style at the top of the GREP style list. I am not sure why it works now…
Copy link to clipboard
Copied
Magic - thank you! Yes I guess it's some kind of hierachy thing. I figured it didn't matter whereabouts in the text the expression appeared but it obviously does. Thanks again.