• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

GREP help - search and replace formatting of a journal entry dates

Participant ,
Mar 21, 2018 Mar 21, 2018

Copy link to clipboard

Copied

Hi -

Trying to figure out a quick way to replace a whole lot of date formats from:

Jan. 6. Text

Feb. 22. Text

June 5. Text

to this format:

Jan 6—Text

Feb 22—Text

June 5Text

It's always at the beginning of a paragraph if that helps? 

Views

338

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guide , Mar 21, 2018 Mar 21, 2018

Find:  ^((\w+)\.?)(\h\d+)\.\h

Replace by:  $2$3—

Replace by format:  "Italic" char style

Best,

Michel, from FRIdNGE

Votes

Translate

Translate
Community Beginner ,
Mar 21, 2018 Mar 21, 2018

Copy link to clipboard

Copied

I'm by no means a GREP expert, but I'll take a shot at it:

Find:

^(\w+).(\s\d{1,2}).\s

Replace:

$1$2—

Did you need the dates bold as well? You could probably do that as a separate GREP character style.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Mar 21, 2018 Mar 21, 2018

Copy link to clipboard

Copied

Find:  ^((\w+)\.?)(\h\d+)\.\h

Replace by:  $2$3—

Replace by format:  "Italic" char style

Best,

Michel, from FRIdNGE

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 21, 2018 Mar 21, 2018

Copy link to clipboard

Copied

You're a GENIUS!!!!!!  Works like a charm. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 23, 2018 Mar 23, 2018

Copy link to clipboard

Copied

LATEST

Thanks for that, Michel; good to learn a better way of doing it! (Also, I'd never known of the \h!)

Best,

Ben

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines