我有一些來自 XML 文檔的文本,我試圖在其中提取包含某些單詞的標(biāo)簽中的文本。例如下面:search('adverse')應(yīng)該返回包含單詞“adverse”的所有標(biāo)簽的文本Out: [ "<item>The most common adverse reactions reported in subjects receiving coadministered dutasteride and tamsulosin were impotence, decreased libido, breast disorders (including breast enlargement and tenderness), ejaculation disorders, and dizziness.</item>" ]和 search('clinical')應(yīng)該返回兩個(gè)結(jié)果,因?yàn)閮蓚€(gè)標(biāo)簽包含這些詞。Out: [ "<title>6.1 Clinical Trials Experience</title>", "<paragraph id="ID41">The clinical efficacy and safety of coadministered dutasteride and tamsulosin, which are individual components of dutasteride and tamsulosin hydrochloride capsules, have been evaluated in a multicenter, randomized, double-blind, parallel group trial (the Combination with Alpha-Blocker Therapy, or CombAT, trial) </paragraph>" ]為此我應(yīng)該使用哪些工具?正則表達(dá)式?BS4?任何建議都非常感謝。示例文本: </highlight> </excerpt> <component> <section id="ID40"> <id root="fbc21d1a-2fb2-47b1-ac53-f84ed1428bb4"></id> <title>6.1 Clinical Trials Experience</title> <text> <paragraph id="ID41">The clinical efficacy and safety of coadministered dutasteride and tamsulosin, which are individual components of dutasteride and tamsulosin hydrochloride capsules, have been evaluated in a multicenter, randomized, double-blind, parallel group trial (the Combination with Alpha-Blocker Therapy, or CombAT, trial) </paragraph> <list id="ID42" listtype="unordered" stylecode="Disc"> <item>The most common adverse reactions reported in subjects receiving coadministered dutasteride and tamsulosin were impotence, decreased libido, breast disorders (including breast enlargement and tenderness), ejaculation disorders, and dizziness.</item>
添加回答
舉報(bào)
0/150
提交
取消