Hopefully we are talking about 1 paragraph...
(If not = you need to run a script each time you want to format those boxes)
If this is your goal:
you could fill GREP tab in paragraphStyle definition like this:
apply style: red
to text: (?s)^METAL.+
Thanks Jarek for your quick response.
It's exactly what i ment. But i'm doing something wrong and don't get the same result u did...
Is it possible to send the .indd file wich u made, so i can compare it with mine?
1. modify (?s)(?<=^METAL).+(?=i$) especially if you are testing this with 1-letter at the end of text box
2. order of GREP matter, so format is applied/wiped "step by step" and it fails while typing/deleting part of texts. Style should be re-applied in this case.
Probably this GREP definition is NOT smart enough
Thx for looking at my issue Jarek.
It gave me a better look at GREP. I hoped it was a simple thing to solve, but i see now it is harder then it looks.
Again thx for your help.