Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

GREP Positive Look Behind Issue

Return to Member Forum

  • Author
    Posts
    • #102006

      Hello indesigners. I just wanted to know if anyone else had an issue with using the Column break in a positive look behind query.

      I’m trying to get rid of all the extra para breaks that come after the Column break using “(?<=~M)p+” but it doesn’t pickup anything. I thought I might just have the wrong markup but when I copied the Col break and pasted it into the “Find what:” it came up as “\r”. I did the same with a page break and it too came up as “\r”. Both breaks were inserted straight from the Type menus too so I know it wasn’t just my shortcuts.

      Maybe it’s a connected issue but I was testing with a positive look ahead the GREP query only seems to be able to reach a maximum of 4 or 5 instances in a row. All these were tested on the same section of 6 paragraph breaks followed by a col break.

      “\r+(?=~M)” shows 4 instances
      “\r{4}(?=~M)” shows 4 instances
      “\r{4,}(?=~M)” shows 5 instances
      “\r{5}(?=~M)” fails to find anything
      “\r{5,}(?=~M)” shows 5 instances

      Anything above this fails.

    • #102014

      Hi,

      You’re totally right! It’s a Grep code weird behavior! … The way I used to eliminate the issue is a personal small script.

      Best,
      Michel, from FRIdNGE
      michel.allio.fridnge@gmail.com

    • #102016
      Aaron Troia
      Participant

      That is definitely a weird issue, I tried using ~M\K\r+ and InDesign would only find the instances where the column break was on its own line with nothing else but at the same time InDesign couldn’t find anything if the column break was at the end of a paragraph or if the column break had anything else in front of it while on its own line.

      I was just playing with other break characters, have you tried the standard carriage return (~b)? I just tried (?<=~b)\r+ and it seems to find most instances in my test doc. It’s not a perfect work around, but it might be a faster alternative to doing it by hand even though you probably have to go though and review each instance it finds.

    • #102034

      Try this….

      Find: ~M
      Replace: ~M~j

      than

      Find: ~j~b+
      Replace: [leave empty]

    • #102035

      Try this if the return are before the Columns Break….
      Find: ~M
      Replace: ~j~M
      than
      Find: ~b+~j
      Replace: [leave empty] or ~b

Viewing 4 reply threads
  • The forum ‘General InDesign Topics (CLOSED)’ is closed to new topics and replies.
Forum Ads