Fix parsing of image captions containing embedded image options.

Anchor the regexp to the start/end of the string when matching against
magic word patterns, in order not to inadvertently match option text
embedded inside image captions.

Bug: 53312
Change-Id: I44c0102b5e86a2a4c4458bb4a7671e83e8795564
Merge "Fix parsing of image captions containing embedded image options."