Skip to main content
Participant
December 9, 2018
Answered

GREP search help: digit+space changed to digit+tab

  • December 9, 2018
  • 2 replies
  • 1576 views

Hi all, sorry for what I am sure is but one of many GREP questions.

Right now I have end notes that, in the start of each paragraph, begin:

1.[space]

And I'd like to change them all to

1.[tab]

This must happen only at the beginning of each paragraph and that's kind of the hard part since the above construction takes place in various places in each paragraph.

Any help would be appreciated.

This topic has been closed for replies.
Correct answer winterm

In Find/Change dialog GREP tab:

Find what: ^\d+\.\K\h

Change to: \t

2 replies

winterm
Legend
December 9, 2018

You can think about \K as a some kind of a Positive Lookbehind, and \h stands for any horizontal whitespace.

winterm
wintermCorrect answer
Legend
December 9, 2018

In Find/Change dialog GREP tab:

Find what: ^\d+\.\K\h

Change to: \t

Jongware
Community Expert
Community Expert
December 9, 2018

That ought to work – but, no explanation? 

winterm
Legend
December 9, 2018

Ha! Couldn’t it be a part of OP’s homework?

Here’s a decent start: find and install a bit outdated but still excellent script What the GREP by Jongware (I bet you know that guy ), and you’ll find most explanations for this and many other codes. Well, except some relatively new…