Reputation: 6195
I want to remove from a tetxt any parenthesis that end with a number. So I use this regex : \(.+?(\d+)\)
This regex remove the text like (1980) or (pp. 100) but it will also remove the whole phrase below:
(etc) and new frontiers in Social Neuroscience (pp. 127-151)
Which regex will ignore the first parenthesis above?
Upvotes: 1
Views: 166
Reputation: 67988
\([^)]*\d+\)
You need to use this.Your regex fails on (etc) and new frontiers in Social Neuroscience (pp. 127-151)
as it says find a (
then find the first \d
which is 127
here and the find )
.
Upvotes: 4