Quote:
Originally Posted by chaley
The problem might be related to the expression failing if there isn't an annotation in the comments.
Try
Code:
{comments:'contains($, '(?i).*?last page read: location \(\d+\)', re($, '(?i).*?last page read: location \((\d+)\).*', '\1'), '')'}
This checks to see of the regular expression
Code:
(?i).*?last page read: location \(\d+\)
matches the comments. If it does, then it calls 're' to slice out the number. If it does not, then it returns '' (the empty string).
The (?i) does indeed mean ignore case.
The string test for 'last page read: location \(\d+\)' must match exactly. No extra spaces, no extra punctuation, no variants in spelling, and parenthesis around the numbers.
Ahh... looking at your original example, I note the % character. I didn't account for that. Try
Code:
{comments:'contains($, '(?i).*?last page read: location \(\d+%\)', re($, '(?i).*?last page read: location \((\d+)%\).*', '\1'), '')'}
|
Hi chaley
Again thanks for the effort so far !
tried your last code, but column is blank
Testing on a book with just the annotations in comments, the HTML of the comments are as follows:
<div class="user_annotations">
<span style="font-weight:bold">
10-12-2010<br>Last Page Read: Location 4862 (99%)
</span>
<br></div>
This is over my head, I'm afraid.
Hope you're still willing to look at this.