View Single Post
Old 07-25-2012, 01:31 AM   #1
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
Posts: 13,606
Karma: 79436940
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
Bulk Edit of comments using regex

I'm trying to clean up the comments in my library to remove the "percentage read" values that I added once using the Kobo driver module.

Basically, it adds to each book that was on the Kobo the following comment at the end of the existing comment:
Code:
<div class="user_annotations">
 <span style="font-weight:normal">
  <hr><b>Book Last Read:</b> 2012-03-04 00:14:27<br><b>Percentage Read:</b> 0%<hr></span>
 <br></div>
I thought my safest bet would be to add a new column while I test the reg-exp and tried the following:
Code:
Search Field: comments
Search For: (?m)(.*?)<div class="user_annotations">.*?</div>(.*)
Replace with: \1\2
Destination Field: #mycomment
Mode: replace field
Unfortunately, all that seems to happen is that #mycomment now contains a copy of the comments field.

What have I over looked here?
PeterT is offline   Reply With Quote