Reply To: En space between abbreviations with GREP!?

#57384

So far you seem to be doing alright :) Except — an en-space? Isn't that far too wide? Perhaps you meant a Thin Space? (If so, use ~< below where I now have ~>)

It's fairly easy — you don't really want this:

w. w..

because the first w may be the last character of a longer word. So all you have to do is insert a word break b before that first w!

b[ul]. [ul].

(I'd rather suggest using [ul] instead of w, because the 'word character' set also includes digits.)

With all parentheses in place, this would be your Find

b([ul].) ([ul].)

and this your Replace

$1~>$2

(Advanced:

It's also possible to use Lookbehind/Lookahead, like this:

(?<=b[ul].) (?=[ul].)

and then you'd only have to use this in Replace:

~>

I think the Lookbehind/Lookahead approach would be slightly faster, because ID only has to 'touch' the space itself (although the actual difference would be very minor).)

This article was last modified on October 15, 2010

Comments (0)

Loading comments...