Search (selected files):
(<p>chapter )\d+
Regex-Function:
Code:
def replace(match, number, file_name, metadata, dictionaries, data, functions, *args, **kwargs):
num=number
return match.group(1)+str(num)
replace.file_order = 'spine'
And:
Replace all.
Useful link:
http://manual.calibre-ebook.com/function_mode.html