ms word - RegEx : Remove line breaks if lookbehind shows a lowercase -


i'm doing ctrl+h (find & replace) in notepad++

i want find line breaks followed lowercase characters in order replace them space character ; thereby removing unwanted break lines in text.

find : \r\n+(?![a-z]|[0-9])

replace : insert space character here

*make sure selected "match case" , "regular expression".

it works perfect.

now, i'd same in microsoft office word documents. clues?

in microsoft word, following:

  1. on home tab, in editing group, click replace open find , replace dialog box.

  2. check use wildcards check box. if don't see use wildcards check box, click more, , select check box.

  3. in find what: box, enter following regular expression: ([a-z])^13

  4. in replace with: box, enter: \1 - thats: (backslash 1 space) (don't forget space!)

and that's it! click either replace button or replace all button.

note: in ms word, ^13 character matches paragraph mark @ end of each line.

here's more information microsoft word , regular expressions - http://office.microsoft.com/en-us/word-help/find-and-replace-text-by-using-regular-expressions-advanced-ha102350661.aspx

edit:

oh, above matches lowercase letter preceding line break.

if want match line break followed lowercase letter, following:

  1. in find what: box, enter following regular expression: ^13([a-z])

  2. in replace with: box, enter: \1 - thats: (space backslash 1) (don't forget space!)

tested both ways , both work in microsoft word 2010, documentation says regular expressions supported in versions 97 - 2013.

good luck! :)


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -