Quote:
Originally Posted by Mixx
Hi everyone,
I learned enough about regular expressions that I can extract parts of, say, titles to rearrange them. This time, however, I have a bunch of books of a series and the series number ended up in the title. I can extract that that serial number all right, but when I try to assign it to the series_index field I get the error message that it can not be converted to float.
How do I fix that? There must be some Python magic that is beyond by regexp skills.
Thanxx for any help,
Mixx
PS: May I suggest that in a future release this is taken care of and there is an automatic conversion to float (why float, why not integer BTW) if a number string is assigned to series_index?
|
Search/Replace accepts integers just fine. As adoby said, you must be including some non-numeric characters in the result, such as the brackets.
Assuming the series is in brackets and that none contain decimal points, the search expression should be something like "^.*\[([\d])\].*$" and the replacement expression should be "\1"