Find and replace with parenthesis

Copper Contributor

Hello again.

 

I'm trying to remove bibliographical references in my text, by searching and replacing it. 

The problem is, the references have a variable number of characters, but all of them start and end with

a parenthesis. Another thing they have in common is that all of them have a page abbreviation "p.".

 

Here's an example:

 

(POE, Edgard Allan. The Raven. 15ª ed., California: SLG Publishing, 2020, p. 18-19)

 

So, to find them I tried this:

(\([0-9A-z]* p. *[0-9A-z]\))

 

Wildcards set to true.

 

Somentimes it would return no results, even though I knew the reference was there.

Sometimes the result would be correct, selecting the reference at the opening parenthesis and ending with the close parenthesis.

Sometimes would not work, resulting in a selection of the entire file (although would still stop at the close parenthesis, would select all the text before the open parenthesis.)

 

What is wrong here, then?

3 Replies

@cindix If there is no other text in parentheses in your document, use the following wildcard search string

\(*\)

 

That's the thing. There are other texts with parentheses. Which is why I was trying to distinguish it with the "p." text parameter.
OK. So, I added a period at the beginning of the expression to prevent it to selecting all the previous paragraphs. Apparently, it was selecting the first opening parentheses amongst all the text.
It looks like this now: (. \(* p. *\).)

So far it is working. If I see another error, I'll post it here. Thanks for your assistance!