Problem w apostrophe (when removing parenthetic expression)

A swapping-ground for Regular Expression syntax

Problem w apostrophe (when removing parenthetic expression)

Postby DeveloperDan » Wed Mar 04, 2015 8:09 pm

Apostrophes are breaking my regular expression. I'd like to remove all text within and including the parentheses. This expression works unless an apostrophe exists outside the parentheses:

Match: (.+)(\(.+\))(.+)
Replace: \1\3

Exactly Like You (McHugh-Fields) - Sue Raney.mp3

returns

Exactly Like You - Sue Raney.mp3

but

Don’t Take My Happiness (Stone) - Sue Raney.mp3

doesn't work. Also there is an unwanted space before the hyphen in all cases which I'd like removed.

Thanks in advance!
DeveloperDan
 
Posts: 1
Joined: Wed Mar 04, 2015 7:55 pm

Return to Regular Expressions