Copy link to clipboard
Copied
Hi everyone,
So I do a promotional catalog once a moth with deals, discounts, and free gifts on just about every page. The table of contents ends up being used as a kind of cheet sheet for customers, and so over the last year at this job I've managed to set up all my paragraph styles to get the ToC generator to do about 90% of the work of getting it perfect. I've managed to set up GREP find/change all for $ off, % off, and BOGO, but I'm stuck on the free gift. Essentially, the way the promo will come on the ToC page looks something like this:
Free Gift(promo item name)With purchase(# to purchase if more than 1)While Supplies Last(promo item #)
The lack of space is intentional. On the actual ad, they use force line breaks to set up the nested styles to switch from headline, to information, to fine print. I'm trying to use GREP to change it, but the code is a little more complicated than I have experience with:
Free (promo item name): (promo item #)
So essentially, what I'm struggling with is getting rid of "Gift" while keeping the promo item name, then getting rid of the purchase conditions and while supplies last, but keeping the item # (which isn't always just numbers). Any help would be appreciated.
Copy link to clipboard
Copied
You could try the following expression
Free Gift(.*)With purchase.*While Supplies Last(.*)
Now $1 would have promo item name and $2 would have promo item #. So the substitution string would be
Free $1:$2
See the working sample at the following link
https://regex101.com/r/svkPcA/1
-Manan