After preparing my LaTeX bibliography in .bib file, I discovered that there's an issue with capitalisation.
According to: this information, solution is to add brackets to each word in each title (as I checked, add brackets to whole title doesn't work).
For example, I wish to change from:
title = "What a interesting title",
title= "What a boring title",
title="What a crazy title",
to:
title = "{What} {a} {interesting} {title}",
title= "{What} {a} {boring} {title}",
title="{What} {a} {crazy} {title}",
so:
title <any number of spaces> = <any number of spaces> " <words in title> ",
should be replaced by:
title <any number of spaces> = <any number of spaces> " <{Each} {word} {in} {title} {should} {be} {in} {bracket}> ",
I'm trying to do that by Regex in Python but have no idea what is wrong.
My code:
re.sub(r'(title[\s-]*=[\s-]*\")(\b(\w+)\b)',r'\1{\2}',line)
add brackets to the first word only.