"Find and replace" with regular expressions in MS Word 2016

4

I have a list with result of the candidates of a public contest that I want to sort by note. However, before making the necessary classification remove the registration number of each competitor, which follows the following format, for all:

380.01227119/3

How can I use a regular expression in the "Find and Replace" function of MS Word 2016 to remove all subscription numbers?

Edit 1 - Sample Content File

380.01229569/6; ADAILDSON DE OLIVEIRA MAIA FREITAS; 18,50; 4,50; 38,00; 61,00 / 380.01245362/3; ADAILSON GASPAR DE JESUS; 8,50;  12,50;  24,00;  45,00  /  380.01238440/2;  ADAILTON  SILVA  OLIVEIRA;  20,50;  6,50;  40,50;  67,50 /  380.01232099/7;  ADEILSON  DA SILVA  MARTINS;  4,00;  6,50;  27,00;  37,50  /  380.01240923/7;  ADONIAS  REBOUÇAS  DOS  SANTOS;  19,00;  11,00;  37,50;  67,50
    
asked by anonymous 21.06.2017 / 21:15

3 answers

4

You can use the following expression in Word: ([0-9]{3}.[0-9]{8}\/[0-9]{1};)

Where:

  • [0-9]{3}. : selects 3 numbers before the point + the point. Home
  • [0-9]{8}\/ : selects 8 numbers before the bar + the bar. Home
  • [0-9]{1}; : selects 1 number before the semicolon + semicolon.

The expression should be enclosed in parentheses for Word to interpret the expression.

So I saw \d not interpreted by Word, so it should be replaced with [0-9]

You have an example functional documentation.

Remember to check the option: Usar caracteres curinga when you apply the filter.

    
21.06.2017 / 22:08
2

You can use the following regex ^\d+\.\d+/\d; it says to always capture at the beginning one or more digits ( ^\d+ ) followed by a dot ( . ) followed by one or more digits ( \d+ ) followed by a bar / and exactly another digit.

In the test I performed, I used the following formatting for the information:

380.01229569/6; ADAILDSON DE OLIVEIRA MAIA FREITAS; 18,50; 4,50; 38,00; 61,00 /
380.01245362/3; ADAILSON GASPAR DE JESUS; 8,50;  12,50;  24,00;  45,00  /
380.01238440/2;  ADAILTON  SILVA  OLIVEIRA;  20,50;  6,50;  40,50;  67,50 /
380.01232099/7;  ADEILSON  DA SILVA  MARTINS;  4,00;  6,50;  27,00;  37,50  /
    
21.06.2017 / 21:37
0
^[^A-Z]+

I do not use windows, much less word, but this regex means: At the beginning of the line (^) go over everything up to a capital letter [^ A-Z]. It should work in word, because it sure works in LibreOffice

    
24.01.2018 / 20:02