Reply To: Grep help – positive look behind

Home Page / Forums / General InDesign Topics (CLOSED) / Grep help – positive look behind / Reply To: Grep help – positive look behind

#76360
Aaron Troia
Participant

Keep (\K) is similar to a lookbehind, it consider’s everything before it as zero width but unlike a lookbehind it isnt greedy (ie you dont have to be explicit and you can use modifiers), so in the case of your GREP search (I couldnt get it to work but just using it as an example), actually let’s change the page breaks to tabs to simplify things:

\K.+?\r

but what if you wanted to search for multiple tabs, in a lookbehind you would have to be explicit in how many tabs you were looking for, but with Keep you can use modifiers (such as +) to complete your search where as it would error out with a lookbehind:

+\K.+?\r

This article was last modified on July 1, 2015

Comments (0)

Loading comments...