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

how to delete text within parentheses

Contributor ,
May 28, 2018 May 28, 2018

Copy link to clipboard

Copied

I need to delete text within  and including the parenthesis in a generated ToC. I've tried  usign GREP but  it seems I cannot delete text - is that correct. Although I have been able to delete text one letter at a time

followign example: SIDE-ANGLE UTTHITA PARSVAKONASANA) [tab] 56 - I need to delete teh (UTTHITA PARSVAKONASANA) but leave the tab character and the page number so I cannot simple delete to end of line. I ahave tried various GREP expressions such as:

\(\d* which deletes only teh first (

\(.* which deletes everythign  to teh end of teh line [includign tab and page number]

If I could only capture teh text - I could change it's color by applying a style and then replace everytihgn in that color

Views

1.6K

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

Community Expert , May 28, 2018 May 28, 2018

Try this to delete only the parenthesis...

Find: \((.+?)\)

Change: $1

Or this to delete the parenthesis and the text:

Find: \(.+?\)

Change: leave empty

Votes

Translate

Translate
Community Expert ,
May 28, 2018 May 28, 2018

Copy link to clipboard

Copied

Try this to delete only the parenthesis...

Find: \((.+?)\)

Change: $1

Or this to delete the parenthesis and the text:

Find: \(.+?\)

Change: leave empty

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
Contributor ,
May 28, 2018 May 28, 2018

Copy link to clipboard

Copied

LATEST

sorry -  teh 2nd part of the answer worked like a charm - much easier than my solution

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 Expert ,
May 28, 2018 May 28, 2018

Copy link to clipboard

Copied

I need to delete text within and including the parenthesis

In that case, use the beginning of Jean-Claude's answer to find the parentheses and the text inside, but replace with nothing (leave the change field blank).

~Barb

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
Contributor ,
May 28, 2018 May 28, 2018

Copy link to clipboard

Copied

I tried that - it did not change anything  - however I did find a  long workaround using combo of text and GREP

Text

1. repalced all (  with line break and (  "^n( "

2. repalced all ) with ) and end of paragraph  ")^p"

GREP

3.   \(.*    &  left change to blank

Text

4. repalce all linebreaks and end of paragraph with nothing [left change blank]   "^n^p"

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