I have a nook, and the only real regexes I've written are for fixing stylesheets to work around its margin bug: if "publisher defaults" are disabled, the nook doesn't handle the css "margin" setting. I've been using these to convert all 4 forms of "margin" to the equivalent margin-top, margin-right, etc. These were written for Sigil, but I *think* they work in the calibre editor.
First: find margin:
Find: margin *:
Convert margin: a (single value):
Find: margin *: *([^\s;]+)(\s*(;|}))
Replace: margin-top: \1; margin-right: \1; margin-bottom: \1; margin-left: \1\2
Convert margin: a, b (2 values)
Find: margin *: *([^\s;]+) +([^\s;]+)([\s]*(;|}))
Replace: margin-top: \1; margin-right: \2; margin-bottom: \1; margin-left: \2\3
Convert margin a, b, c (3 values)
Find: margin *: *([^\s;]+) +([^\s;]+) +([^\s;]+)([\s]*(;|}))
Replace: margin-top: \1; margin-right: \2; margin-bottom: \3; margin-left: \2\4
Convert margin a, b, c, d (4 values)
Find: margin *: *([^\s;]+) +([^\s;]+) +([^\s;]+) +([^\s;]+)(\s*(;|}))
Replace: margin-top: \1; margin-right: \2; margin-bottom: \3; margin-left: \4\5
|