Updated doc in template wrapping + DRYed out a regexp from the code

Change-Id: I872689ee800272ac5fda925f5211f1c68a7f94b6
Merge "Updated doc in template wrapping + DRYed out a regexp from the code"