View Single Post
Old 04-08-2018, 10:04 AM   #16
compurandom
Wizard
compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.
 
Posts: 1,016
Karma: 500000
Join Date: Jun 2015
Device: Rocketbook, kobo aura h2o, kobo forma, kobo libra color
If you use regex, .* matches everything in the source.
If you use (.*) then it also saves that in a group parameter, so the first () can be retrieved in the replacement box with \1 and the second one with \2 etc...

so if you wanted to do something fancier than just copying the value, you could.

For a silly example, if you wanted to insert the old series in the middle of the date, you could use these values:

template: {:'format_date(raw_field('pubdate'), 'yyyyMM')'}{series_index}
search for: (....)(..)(.*)
replace with: \1-\3-\2

And this would put the series index between the year and month...not that I think this is useful or anything but silly...

And the above example probably wouldn't work because it's no longer a number with the dashes, but yes, if you want to set the series, you'd set destination to series index.
compurandom is offline   Reply With Quote