Reply To: GREP Tricks: Using LookBehind and LookAhead expressions to convert a SPACE into a NON-BREAK SPACE

Home Page / Forums / General InDesign Topics (CLOSED) / GREP Tricks: Using LookBehind and LookAhead expressions to convert a SPACE into a NON-BREAK SPACE / Reply To: GREP Tricks: Using LookBehind and LookAhead expressions to convert a SPACE into a NON-BREAK SPACE

#72145
Aaron Troia
Participant

I’m wondering why you pipped and wrote out all the lookbehinds and lookaheads, the lookahead is non-greedy, unlike the lookbehind, so you could’ve done something like this

(?<=\d) (?=mile|gallon|kg|day)

or if you need both to be non-greedy, I use this more in HTML/CSS after ePub Export, but you could use Keep (\K)

\d+\K (?=mile|gallon|kg|day)

This article was last modified on December 9, 2014

Comments (0)

Loading comments...