Greedy match in MS Word regular expression?

I need to clean up some tables in Word, where semicolons and text after them is redundant, e.g.

text1 ; text 2

where above is a content of one cell and I need to remove semicolon and everything after it until end of cell; unfortunately text 2 doesn't have any specific pattern.

I try to do that with Word's built-in find and replace using regex.

As the desired end of my regular expression is the end of the cell, I can't match it, I've tried several combinations of any character ;?* ;* ;?@ but all stops at the shortest matching text, is there a way to make it match until end of cell?


This seems to be working:

;[!¤]{1,}

I used generic currency sign ¤, you may use any other symbol you are sure is not included in text following semicolon (maybe it's semicolon itself).

Just a note: leaving curly brackets' second bound empty does not mean an endless string, I found out by trial that the extent is limited to 255 chars.


I need to remove semicolon and everything after it

Use the following regular expression:

;?{1,9999}^13
  • {n,m} matches from n to m occurrences of the previous character or expression
  • ^13 matches a paragraph break

Source Find and replace text by using regular expressions (Advanced)