Are you looking for scripting solution or UI?
"$" and "." both are wildcards in GREP,so you have to escape them (in UI: "\$" and "\.") to make it working.
try the following:
(Over )?\d+% OFF|\x24?\d+\.\d+
or if you want to find those combinations only at the beginning of a paragph:
^((Over )?\d+% OFF|\x24?\d+\.\d+)
Thank you so much for your help with this. I have another what seems to be an easy string to match that either partially works or fails altogether.
I have a phrase that follows the first expression - the phrase is "with your 25% savings pass!". There are variations of the phrase, but it always begins with the word "with", includes a % sign, and ends with a paragraph return. I read Peter Kahrel's "Automating InDesign with Regular Expressions" and came up with this expression: with [A-Za-z0-9%]\r That doesn't work at all. If i remove the end of paragraph, \r, then the expression partially works, identifying "with and the "y" in "your" but nothing else. Am I messing a repeat 1 or more times character?
OK, I think I've got it. Is the expression below the best way to match the phrase "with your 25% savings pass!". Again, there are variations of the phrase, but it always begins with the word "with", includes a % sign, and ends with a paragraph return.
Am I messing a repeat 1 or more times character?
Yes. Everything in  counts as one character. Instead of [A-Za-z0-9%]\r you coud also write [\w%]\r . This will find only the last character before the return. But this will not find spaces or dashes!
To find more you could use 'with .*\r' as you mentioned. But this will also find "with all my friends." followed by a return. So this is maybe not the best way.
If you know, that you have digits, followed by a space or not and a percentage character in your text, include it in your expression!
So this 'with.+\d+\s?%.+\r' will find "with your 25% savings pass!" followed by a return, but not "with all my 25 friends"
Thanks again. This can get convoluted, so I appreciate the advice. Now I am seeing instances where the line "with your 25% savings pass!" has to be broken via a soft return (shift + return key) When broken, the second line no longer starts with the word "with", so the grep style is not applied to the new second line. Is there a way to tell a grep style to carry on through a soft return?
Sure. Please make a screenshot from this part. It is then easier for me to give you the correct grep.
Interesting grep: ^with(\n?.)+\d+%(\n?.)+$
Thanks for your samples. First of all, live isn’t always easy ;-)
Apply some colors to your character styles and you will see, that your first style isn’t honored (OFF > off)
Second: It is a big difference for grepstyles, if you enter a softreturn in the same paragraph or you enter a hard return (new paragraph).
Since the scope of grepstyles is paragraph based, your second para did not know the first one.
So in your special example you could use (with|coupon)[^\r]+
That means, search for: with or coupon, followed by anything that is not a hard return, multiple times.
But if you have other phrases, this may not work or must be extended.
Thanks everyone who helped me with the above question. I am getting more variance in the text that when I initially wrote. Here is a typical range of what would need to match with an expressions. Is this too free-form for a grep expression? Any ideas on this would be appreciated.
Over 00% OFF
Up to 00% off