I have been using GREP and GREP styles and thought I was fairly good at it…until this morning. I have a job that comes to me as simple text. and have to apply the styling to all the questions within paragraphs. Something easy enough to do with a GREP find/replace. The paragraphs open with a question. That can be addressed with a nested character style in the paragraph style. \
The GREP expression I am using for rest of the questions: ((?<=\.).*?(?=\?)\?)
In English, I want to find any characters from a period (but not the period) until a question mark is encounter and add the question mark to the marked subexpression.
My expression works on all but one instance and I can’t figure out why. Here is the text that I am working on.
AROMA NATURALS /// SOY VEGEPURE® CANDLE – ASSORTED SCENTS
WHAT IS IT? 100% natural soy candle with essential oils and pure plant aromas. HOW DO I USE IT? Simply light the lead-free candle wick and enjoy. WHY IS IT IN THE BOX? Made from 100% pure plant aromas and natural vegetable waxes, they are as good for the environment as they are for you.
CALBEE /// LIGHTLY SALTED SNAPEA CRISPS
WHAT IS IT? Tasty baked, lightly salted snapea crisps made from 70% whole pea. HOW DO I USE IT? Open, eat, and bask in the glory of your healthy eating. WHY IS IT IN THE BOX? It’s the perfect natural snack. Snapea crisps have less fat, more fiber, and lower sodium than regular potato chips.
THESIS BEAUTY /// EYE SERUM
WHAT IS IT? Superbly moisturizing organic eye serum. HOW DO I USE IT? Apply morning and night on moist skin just below the eyebrows and under eyes. WHY IS IT IN THE BOX? Made from certified organic oils and all-natural vitamin E, this serum is a lullaby for your skin.
JOYFUL BATH CO. /// ‘NILLA BUTTERMILK® RENEWING BATH SOAP
WHAT IS IT? A seriously wonderful-smelling handmade botanical soap. Soul?soothing vanilla mingles with skin?softening buttermilk and its natural emolients. HOW DO I USE IT? Wash your hands and smell the goodness this soap has to offer your senses. WHY IS IT IN THE BOX? Handmade and hand-cut, this natural bar is preservative?free. Rinses clean and smells good, too!
The problem is that on the last “HOW DO I USE IT?” GREP selects all the way back to “Soul-smoothing…” If I delete that sentence the GREP works fine. I thought it might be related to the “-“(hyphen) but it works elsewhere when there is a hyphen in the sentence preceding the question.
Can anyone see what I am missing”
Regards,
Ken