3 Replies Latest reply on Jun 27, 2013 4:47 AM by Peter Spier

    GREP: Zero or more break characters (e.g. ~R*) doesn't work?

    alanomaly Level 1

      I'm trying to make a GREP rule that includes something to pick up any frame break characters at the start, if there are any, and carry on if there aren't.

       

      This should do the job perfectly...

       

      ~R*.someGREP

       

      ...but it doesn't pick anything up. The .someGREP should happen whether there are break characters or not, but it does nothing. Other things I've tried with the same result:

       

      ~R?.someGREP

      (~R?).someGREP

      (~R)?.someGREP

      (~R*).someGREP

      (~R)*.someGREP

      (~R|.).someGREP

       

      ...why are these not working? How can I tell it to pick up any frame breaks, if there are any, and carry on regardless if there aren't?

       

      All of these with a regular character (e.g. 'R') instead of the break character (~R) work as expected.

        • 1. Re: GREP: Zero or more break characters (e.g. ~R*) doesn't work?
          Peter Spier Most Valuable Participant (Moderator)

          I'm seeing nearly the same thing -- ~R*.+ picks up the break and the first paragraph following if a break is present, but not anything after if I tell it to find next. When I removed the break fromthe text and ran the query ID actually crashed. I'm hardly the leading GREP expert, but I suspect there may be a bug in play.

           

          I'm curious why you would want to include the frame break with text found in the following frame?

          • 2. Re: GREP: Zero or more break characters (e.g. ~R*) doesn't work?
            alanomaly Level 1

            It's for something using similar logic to the GREP in http://forums.adobe.com/message/5450896#5450896 but for a different purpose.

             

            I'm now doing it a different way, but the original idea was, a paragraph style GREP rule that marks places where frames need to break and styles them accordingly, then a GREP find change on (?<!.)[^~R]+(?!.) and the GREP-added character style, to add breaks to these positions but only if it's not already been done. For this to work, the paragraph style GREP rule needs to apply the character style to any breaks as well as the subsequent text (i.e ~R*.someGREPrule), else the find-change won't be able to see where the breaks have already been added.

             

            I've since found a different approach to the whole problem. But this still seems like a bug.

            • 3. Re: GREP: Zero or more break characters (e.g. ~R*) doesn't work?
              Peter Spier Most Valuable Participant (Moderator)

              I'm quite sure what you intended with that last expression, it seems to find an entire story.

               

              And the logic of marking a frame break makes no sense to me, I'm afraid. Why aren't you able to use a keep option in the paragraph style that starts in next frame?