View Single Post
Old 08-15-2012, 10:14 AM   #9
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,145
Karma: 60406498
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by nynaevelan View Post
That is real close, but I do not know what to select to change it from the example to what I have. I tried reading the instructions but I am just comprehending what it is telling me to do.
It is all about identifying patterns you can latch onto as triggers.
Using your sample
Code:
Dead Silence (The Body Finder, #4)
first: series info is delineated by the ( and )
second: the series_index value is DIGITS after a , # (comma space hash)

so now we know where series starts and ends and where the number is
We also see there are some special REGEX reserved characters that will need special treatment (I have split onto many lines to explain ONLY)

Dead Silence (The Body Finder, #4)

(.+) \( capture #1 the Title and eliminates the space (
(.+)\,\s\# capture #2 the series name and eliminates the comma space hash
(\d+)\) capture #3 grabs the series_index and eliminates the closing )

All together:
Code:
(.+) \((.+)\,\s\#(\d+)\)
A replace of: \1 (\2, #\3)
would put it all back together
theducks is offline   Reply With Quote