I'm struggling to match a few movie titles i have in a weird format. Some of the titles are wrapped in quotes and some begin with #
or $
, and most of them end with the release year at the end (otherwise ????).
I'm trying to replace this:
"Ein Engel für alle" (2005) {Katzenjammer (#2.5)} ????
#"Sospecha" (1963) {El caso del viejo del Tibet} 1963
MTV Europe Music Awards 1998 (1998) (TV) 1998
"Hotel Cæsar" (1998) {(#12.26)} 1998
$Am Rande - Sechs Kapitel über AIDS in der Ukraine (2006) 2006
...to this:
Ein Engel für alle, ????
Sospecha, 1963
MTV Europe Music Awards 1998, 1998
Hotel Cæsar, 1998
Am Rande - Sechs Kapitel über AIDS in der Ukraine, 2006
...and if possible, get the release year somehow. In the example I just put a comma, but if you can't get the release date just leave it and I'll get it another way.
I'm a complete newbie in regular expressions but I still tried to do it with no luck. If anyone can give me a hand I'd really appreciate it!
Edit
To make it less confusing:
Remove everything wrapped in
()
or{}
.Remove the
$
or#
in the beginning of the string.IF the title is wrapped in quotes, remove them.
Either leave it like this, or use some kind of grouping to get the release date at the end of the string to a separate variable?
Hope this helps :)