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

Find and replace

Guest
May 08, 2018 May 08, 2018

Copy link to clipboard

Copied

This should be fairly simple but my grep knowledge is pretty simple. Want to find chapter numbers that have a dash before and after the number and remove the dashes but leave the number. So for example, the word doc I imported has a chapter number of -11- and I want it to be just 11. I can find it using the grep expression -\d\d- but can't figure out how to get rid of the dashes. The number is also set up as a paragraph style.

Thanks to anyone who can help.

Views

296

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 , May 08, 2018 May 08, 2018

Find: -(\d+)-

Replace by: $1

Votes

Translate

Translate
Guide ,
May 08, 2018 May 08, 2018

Copy link to clipboard

Copied

Find: -(\d+)-

Replace by: $1

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
Guest
May 08, 2018 May 08, 2018

Copy link to clipboard

Copied

Thanks Michel

So just so I learn does the plus after d represent more digits?

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
Guest
May 08, 2018 May 08, 2018

Copy link to clipboard

Copied

LATEST

So one more. Have some paragraphs that have a single space before them. If I try to use the built in query to remove leading space, it grabs a hard return that is in the line before the paragraph as well as the single space. How do I prevent that?

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