View Single Post
Old 09-28-2014, 09:09 AM   #6
kite
enturbulated
kite can tell if an avocado is ripe without touching it.kite can tell if an avocado is ripe without touching it.kite can tell if an avocado is ripe without touching it.kite can tell if an avocado is ripe without touching it.kite can tell if an avocado is ripe without touching it.kite can tell if an avocado is ripe without touching it.kite can tell if an avocado is ripe without touching it.kite can tell if an avocado is ripe without touching it.kite can tell if an avocado is ripe without touching it.kite can tell if an avocado is ripe without touching it.kite can tell if an avocado is ripe without touching it.
 
kite's Avatar
 
Posts: 30
Karma: 130494
Join Date: May 2007
Device: Kobo Aura HD
Quote:
Originally Posted by JustForFun View Post
Does (?P<author>.+?)\. (?P<title>.+) work for you? It considers all characters before the first dot followed by a space as author and the rest as title.
...

Thanks for your help people.

(?P<author>.+?)\. (?P<title>.+) does the trick nicely.

And having read "Hey neat ... " for the fifth time has me thinking that I could have made the + in the first phrase of (?P<author>[^_]+)\. (?P<title>.+) non-greedy by adding a ? just so (?P<author>[^_]+?)\. (?P<title>.+)

"Regexes are greedy by default which means that (?P<author>[^_]+)\. matches all characters (which are not '_') before the last dot followed by a space as author."
I had tried many combinations and permutations but all in the second phrase of the expression as I ASSumed that the first phrase stopped matching at the first "\. "

My grasp of regular expressions doesn't let me create and use them in Bulk File Rename yet.
kite is offline   Reply With Quote