Reply To: Why oh why is this GREP query seemingly impossible?

Home Page / Forums / General InDesign Topics (CLOSED) / Why oh why is this GREP query seemingly impossible? / Reply To: Why oh why is this GREP query seemingly impossible?

#59387
Lala Lala
Participant

Thanks grep experts for the ideas so far. My original post wasn't super clear, but yes, I'm trying to apply a grep style (not a search and replace, though that would be pretty sporty… why highlight the problem when you can run a replace that automatically fixes it?)

I do also make css the way oriel describes, with breaks, and yeah, I use shift+enter breaks so grep doesn't hate it. However even then there's frustration… grep's period does not match the shift+enter “character” (if that's what it is)… so I have to hold its hand and put in something like (n)? in every place where I think one might appear. And then there might be more than one. And then there might tab or white space or characters before or after it. I also just figured out that while some grep styles apply dynamically as your text changes, this is one where you must manually apply the paragraph style after, say, deleting a brace, or it doesn't show up.

Jong's final version worked best, and seems to handle manual line breaks wherever I put them. It also handled whitespace and random text between the opening braces. Seems like we have a winner. Oriel, I can see how yours works but it didn't work with my css. I think it's less “bulletproof” than jong's. Jong's I'm still parsing… lookahead for the opening curly brace, then… match anything in the [] character set, that is not a single closing brace? one or more times. Then …negative lookahead and match if there is …NOT NOT an opening brace? haha. I can't understand it much less describe it. Followed by match if } is NOT there.

edit: thanks for the tip about the pencil. Doh.

This article was last modified on April 22, 2011

Comments (0)

Loading comments...