Reply To: GREP – find first space

#75970
Justin Sligh
Member

Jahrod,

(^.+?)(\x20)

\x20 refers to unicode for normal space created by the keyboard’s spacebar (U+0020). includes breaking spaces, which we do not want.

^ Beginning of paragraph.
. Any character
+? One or Many times (Shortest Match)

() Parenthese encapsulates found text for use on the replace function.

We cant do a positive lookbehind with the GREP ^.+? but we can find both and only use the second found set in our replace function.

GREP Find
“Find, as found set one, one or many characters (shortest match), which is followed by, as found set two, a normal space.”

GREP Replace
“Replace with $1, which was the results of the GREP within the first set of parentheses, and a forced line break.”

This article was last modified on June 15, 2015

Comments (0)

Loading comments...