Find/Replace adds a style to what I'm searching for AND the following paragraph
I am using the (wildcards enabled) regular expression ([0-9]{1,})^p to find chapter headings (which are just numbers followed by a carriage return) and replace them with ^m\1^p^p^p and the style Heading 1. The result I am getting is that Heading 1 is improperly applied (I modified Heading 1 to centered, but it is justified in the instances where find/replace makes the changes but centered elsewhere) but also bleeds into the next paragraph. I end up with the page break, and the mis-styled chapter heading, the three returns AND the entire next paragraph styled as Heading 1.
I guess maybe the reason the chapter heading is justified is because it is picking that attribute up from the following paragraph? But how can I keep find/replace from trying to incorporate the two?
Thanks in advance. Sorry if it's already been asked or it's dumb but I'm new to regex and the results I am getting are hard to search for.
I'm using Microsoft Word 2007 on win7-64 in case that's relevant.
|