View Single Post
Old 08-08-2013, 06:18 PM   #9
Adoby
Handy Elephant
Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.
 
Adoby's Avatar
 
Posts: 1,736
Karma: 26785668
Join Date: Dec 2009
Location: Southern Sweden, far out in the quiet woods
Device: Thinkpad E595, Ubuntu Mate, Huawei Mediapad 5, Bouye Likebook Plus
You can match three groups of text, each separated by " - ". That way the actual contents of the groups can be ignored. Just match everything. A little dangerous because it can match titles you don't want to match. Be careful. Make sure you hava a backup and know how to restore it.

^ makes sure the match starts at the first character. Not really needed here, but makes it a little safer to avoid surprises.
.+ means match any sequence of chars, 1 long or longer.

So the pattern could be:
^(.+)\s-\s(.+)\s-\s(.+)

Replace with just the third group:
\3

Actually this would also work:
^(.+)\s-\s(.+)\s-\s

Replace with nothing. The parts that match are deleted.

Or this:
^overworld\s-\s.+\s-\s

Replace with nothing. A little safer, will only work on books with a title that starts with "overworld". Groups are not needed since you don't intend to reference any.

So the pattern could also be:
^.+\s-\s.+\s-\s(.+)

Replace with just the only group:
\1
Adoby is offline   Reply With Quote