正则表达式,提取两个标签之间的所有东西,怎么写?

<hr/><title>CONSTITUTIONOFTHESTATEOFCONNECTICUT</title><p>PREAMBLE.</p><p>Sec.1.Secti... <hr />

<title>CONSTITUTION OF THE STATE OF CONNECTICUT</title>
<p>PREAMBLE.</p>
<p>Sec. 1. Section 25 of article fourth of the constitution is repealed.</p>
<p>Sec. 2. Subsection a. of article twenty-sixth of the amendments to the constitution is amended to
twenty-four hours prior to the time of convening of such special session. Such general assembly shall, upon roll call, by a yea vote of at least two-thirds of the membership of each house, adopt such plan of districting as is necessary to preserve a proper apportionment of representation in accordance with the principles recited in this article. Thereafter the general assembly shall decennially at its next regular session or special session called for the purpose of adopting a plan of districting following the completion of the taking of the census of the United States, upon roll call, by a yea vote of at least two-thirds of the membership of each house, adopt such plan of districting as is necessary in accordance with the provisions of this article.</p>

</article>

如何提取<hr />和</article>之间的所有内容,各位大侠帮忙写一个简单的~
不行啊楼下的几位,我用MTracer试了,还是匹配不上啊。。。。几个答案都试了。。。各位大侠再帮忙想象,就回车和空格的问题吧?
展开
qinshikuan
推荐于2018-04-12 · TA获得超过134个赞
知道答主
回答量:94
采纳率:0%
帮助的人:51.5万
展开全部
最简单就可以:
1. /<hr[^>]*\/>.*<\/article>/is 这是正则的贪婪模式,提取<hr />和</article>之间的所有内容
2. 如果有多对 <hr />和</article>标签,而你只想要第一次出现的标签之间的内容,可以用非贪婪模式:
/<hr[^>]*\/>.*?<\/article>/is
后面的's'必须加入,这是个修正符,有's'则表达式中的'.'代表任何字符(包括回车!)
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
Masic_send
2011-01-05
知道答主
回答量:9
采纳率:0%
帮助的人:7.8万
展开全部
<hr />(.|\n)*?</article>
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
trial499
2011-01-05
知道答主
回答量:88
采纳率:0%
帮助的人:52.6万
展开全部
我想提取字符串中
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
百度网友22b0852c7
2011-01-05 · TA获得超过130个赞
知道小有建树答主
回答量:154
采纳率:0%
帮助的人:141万
展开全部
<hr\/>(.|\n)*(?=<\/article>)
本回答被提问者和网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 1条折叠回答
收起 更多回答(2)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式