Home > Software design >  How to match single line with wildcards in Find & Replace MS Word
How to match single line with wildcards in Find & Replace MS Word

Time:07-08

I have the following text, for which I´d like to match a single line in order to format with blue the whole lines that contains "Axy Opyy" and with yellow the lines that contains "Nmj Trui"

[3:57 p. m., 27/9/2021] Axy Opyy: A regular expression 
[3:58 p. m., 27/9/2021] Nmj Trui: (shortened as regex or regexp;[1] sometimes
[4:19 p. m., 27/9/2021] Nmj Trui: referred to as rational expression[2][3]) 
[5:58 p. m., 27/9/2021] Nmj Trui: is a sequence of 
[5:59 p. m., 27/9/2021] Axy Opyy: characters that specifies 
[5:59 p. m., 27/9/2021] Nmj Trui: a search pattern 
[0:13 p. m., 28/9/2021] Nmj Trui: in text. 

enter image description here

I´ve tried different combinations with wildcard option, like \[?@[!^13]?@\] Axy Opyy:[!^13]{1,} or (\[?@2021\]){1} Axy Opyy:?@^13, but in several cases, matches more than one line. How would be the correct regex to match a single line each time? Thanks

UPDATE

My currently output is this. I´d like to shift to the right a little bit the lines that would be blue. Currently the space to the left is still highlighted. Is there a way to highlight only the text after the space?Or insert a bullet in order that the text look aligned like the image below?

Final output

CodePudding user response:

For example, a wildcard Find/Replace, where:

Find = \[[!^13]@Axy Opyy[!^13]@^13
Replace = ^&

and you specify the replacement colour.

  • Related