D
D
Den Alex Smith2015-11-17 11:53:31
Regular Expressions
Den Alex Smith, 2015-11-17 11:53:31

Find and replace pattern in Word?

Good afternoon!
There is a table (in Word) with a huge number of records of the form:
Ivanova Victoria Vasilievna, born in 1971, higher education, Uryupinsk State Pedagogical Institute, total work experience - 22 years, work experience - 3 years.

We need a search and replace template that will leave only the full name in the cell, and delete the rest.
I tried (with the "Wildcards" checkbox enabled) such a pattern:
(<*>) (<*>) (<*>)*
change to
\1 \2 \3
, but it turns out that it looks for any three sequences and one character after.
Anyone familiar with Word regulars? There is a feeling that it is too simple here, but a stupor is a strong thing))
UPD:
As a result (thanks to @dimonchik2013), this elegant crutch worked faster than all the options:

  1. Search string: ([AZ]*>) ([AZ]*>) ([AZ]*>) (with wildcards enabled)
  2. Replacement string: \1 \2 \3^t
  3. Converting a table to text with a tab delimiter
  4. Convert text to tab delimited table

Profit!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2015-11-17
@netcrox

in general, copy-paste to text, regular expression and back "convert to table" is faster,
but let's see what kind of regexps there are in the Word, in
short, here the rules are all word.mvps.org/faqs/general/usingwildcards.htm catch
garbage in vegetable oil
: ([A- Z]*>) ([AZ]*>) ([AZ]*>)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question