【发布时间】:2021-06-25 23:08:32
【问题描述】:
我需要放一个词,获取包含这个词的html标签。 示例:
- 文本输入:Madhuparna
我需要获取:
-
2021 年 6 月 5 日,作者 Madhuparna
-
bla bla bla Madhuparna bla bla bla
测试文本:
<p>The entire purpose speed up the process.</p><p>June 5, 2021 By Madhuparna</p>\r\n<p>The entire purpose of a terminal emulator is to imitate how the regular computer terminals perform and allowing the main computer to connect to and use a remote computer through a command-line or a graphical interface. The terminal emulators are known to carry out the functions using the software.</p>\r\n<a>It allows file transfer between the main and the remote computer using SSH (Secure Shell) and also enables the host system to execute applications on the remote system. While it features a graphical user interface, programmers rather prefer the text-based interface to gain more control over all functions and speed up the process.</a><p>bla bla bla Madhuparna bla bla bla</p>
我现在做什么但不工作:
<(\S*?)[^>]*>.*?Madhuparna.*?<\/\1>|<.*?\/>
【问题讨论】: