如何在Find&替换MS Word

发布于 2025-02-13 20:58:35 字数 1104 浏览 1 评论 0原文

我有以下文本,我想匹配一条线,以便用蓝色格式化包含“ axy opyy”的整行,并用黄色的线包含“ 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. 

在这里输入图像说明

我尝试了与通配符的不同组合选项,例如\ [?@[!^13]?@\] Axy Opyy:[!^13] {1,}或(\ [?@2021 \]){1 } Axy Opyy:?@^13 ,但是在某些情况下,匹配多个行。每次匹配一行的正确正则是正确的言论?谢谢

更新

我当前的输出是此。我想向右移动一点点蓝色的线条。目前,左侧的空间仍在突出显示。有没有办法仅突出空间之后的文本?或插入子弹以使文本看起来像下面的图像一样对齐?

最终输出

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

廻憶裏菂餘溫 2025-02-20 20:58:35

例如,A 通配符查找/替换,在哪里:

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

您指定替换颜色。

For example, a wildcard Find/Replace, where:

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

and you specify the replacement colour.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文