正则表达式匹配新行

时间:2015-02-24 09:06:21

标签: regex

我需要一个正则表达式来提取以下内容:

<fieldset><input type="hidden" name="costMin" value="32" /><input type="hidden" name="costMax" value="340" /><input class="slider" id="priceSlider" type="text" name="price" value="32;340" /></fieldset></form> </div></div><div class="block_search_filter multiSelect" id="filter_1_ShoeSize" title="Shoe Size"> <div class="cf">
<span class="filter_label">Shoe Size</span><a href="http://tm.stage.arcadiagroup.ltd.uk/webapp/wcs/stores/servlet/CatalogNavigationSearchResultCmd?pageSize=20&amp;catalogId=33056&amp;viewAllFlag=false&amp;langId=-1&amp;sort_field=Relevance&amp;beginIndex=1&amp;categoryId=207294&amp;storeId=12555&amp;parent_categoryId=207282&amp;refinements=category~[1592051|207294]" class="link_clear_filter" title="Clear">Clear</a></div><div class="cf"> <ul> <li class="active" id="f_640" title="6/40" ><a href="http://tm.stage.arcadiagroup.ltd.uk/en/tmuk/category/shoes-and-accessories-1928527/smart-shoes-140525/brogues-2681502?noOfRefinements=1" rel="nofollow" title="">6/40<span class="item_count">(21)</span></a></li> <li class="" id="f_741" title="7/41" ><a href="http://tm.stage.arcadiagroup.ltd.uk/en/tmuk/category/shoes-and-accessories-1928527/smart-shoes-140525/brogues-2681502?refinements=Shoe%20Size{1}~[6%2F40|7%2F41]&amp;noOfRefinements=3" rel="nofollow" title="">7/41<span class="item_count">(22)</span></a></li> <li class="" id="f_842" title="8/42" ><a href="http://tm.stage.arcadiagroup.ltd.uk/en/tmuk/category/shoes-and-accessories-1928527/smart-shoes-140525/brogues-2681502?refinements=Shoe%20Size{1}~[6%2F40|8%2F42]&amp;noOfRefinements=3" rel="nofollow" title="">8/42<span class="item_count">(23)</span></a></li> <li class="" id="f_943" title="9/43" ><a href="http://tm.stage.arcadiagroup.ltd.uk/en/tmuk/category/shoes-and-accessories-1928527/smart-shoes-140525/brogues-2681502?refinements=Shoe%20Size{1}~[6%2F40|9%2F43]&amp;noOfRefinements=3" rel="nofollow" title="">9/43<span class="item_count">(23)</span></a></li> <li class="" id="f_1044" title="10/44" ><a href="http://tm.stage.arcadiagroup.ltd.uk/en/tmuk/category/shoes-and-accessories-1928527/smart-shoes-140525/brogues-2681502?refinements=Shoe%20Size{1}~[10%2F44|6%2F40]&amp;noOfRefinements=3" rel="nofollow" title="">10/44<span class="item_count">(23)</span></a></li> <li class="" id="f_1145" title="11/45" ><a href="http://tm.stage.arcadiagroup.ltd.uk/en/tmuk/category/shoes-and-accessories-1928527/smart-shoes-140525/brogues-2681502?refinements=Shoe%20Size{1}~[11%2F45|6%2F40]&amp;noOfRefinements=3" rel="nofollow" title="">11/45<span class="item_count">(22)</span></a></li> <li class="" id="f_1246" title="12/46" ><a href="http://tm.stage.arcadiagroup.ltd.uk/en/tmuk/category/shoes-and-accessories-1928527/smart-shoes-140525/brogues-2681502?refinements=Shoe%20Size{1}~[12%2F46|6%2F40]&amp;noOfRefinements=3" rel="nofollow" title="">12/46<span class="item_count">(20)</span></a></li>  </ul>  </div></div><div class="block_search_filter multiSelect" id="filter_1_Colour" title="Colour"> <div class="cf">
<span class="filter_label">Colour</span><a href="http://tm.stage.arcadiagroup.ltd.uk/webapp/wcs/stores/servlet/CatalogNavigationSearchResultCmd?pageSize=20&amp;catalogId=33056&amp;viewAllFlag=false&amp;langId=-1&amp;sort_field=Relevance&amp;beginIndex=1&amp;categoryId=207294&amp;storeId=12555&amp;parent_categoryId=207282&amp;refinements=Shoe%20Size{1}~[6%2F40]^category~[1592051|207294]" class="link_clear_filter" title="Clear">Clear</a></div><div class="cf"> <ul> <li class="" id="f_black" title="black" ><a href="http://tm.stage.arcadiagroup.ltd.uk/en/tmuk/category/shoes-and-accessories-1928527/smart-shoes-140525/brogues-2681502?refinements=Colour{1}~[black]^Shoe%20Size{1}~[6%2F40]&amp;noOfRefinements=3" rel="nofollow" title="">black<span class="item_count">(9)</span></a></li> <li class="" id="f_blue" title="blue" ><a href="http://tm.stage.arcadiagroup.ltd.uk/en/tmuk/category/shoes-and-accessories-1928527/smart-shoes-140525/brogues-2681502?refinements=Colour{1}~[blue]^Shoe%20Size{1}~[6%2F40]&amp;noOfRefinements=3" rel="nofollow" title="">blue<span class="item_count">(2)</span></a></li> <li class="" id="f_brown" title="brown" ><a href="http://tm.stage.arcadiagroup.ltd.uk/en/tmuk/category/shoes-and-accessories-1928527/smart-shoes-140525/brogues-2681502?refinements=Colour{1}~[brown]^Shoe%20Size{1}~[6%2F40]&amp;noOfRefinements=3" rel="nofollow" title="">brown<span class="item_count">(10)</span></a></li>  </ul>  </div></div> </div><a href="http://tm.stage.arcadiagroup.ltd.uk/webapp/wcs/stores/servlet/CatalogNavigationSearchResultCmd?pageSize=20&amp;catalogId=33056&amp;viewAllFlag=false&amp;langId=-1&amp;sort_field=Relevance&amp;beginIndex=1&amp;categoryId=207294&amp;storeId=12555&amp;parent_categoryId=207282" class="clear_all" title="Clear All">Clear All</a><div id="espot_aside_1" class="espot">

<form action="CatalogNavigationSearchResultCmd?">
<fieldset><input type="hidden" name="costMin" value="32" /><input type="hidden" name="costMax" value="340" /><input class="slider" id="priceSlider" type="text" name="price" value="32;340" /></fieldset></form> </div></div><div class="block_search_filter multiSelect" id="filter_1_ShoeSize" title="Shoe Size"> <div class="cf">
<span class="filter_label">Shoe Size</span><a href="http://tm.stage.arcadiagroup.ltd.uk/webapp/wcs/stores/servlet/CatalogNavigationSearchResultCmd?pageSize=20&amp;catalogId=33056&amp;viewAllFlag=false&amp;langId=-1&amp;sort_field=Relevance&amp;beginIndex=1&amp;categoryId=207294&amp;storeId=12555&amp;parent_categoryId=207282&amp;refinements=category~[1592051|207294]" class="link_clear_filter" title="Clear">Clear</a></div><div class="cf"> <ul> <li class="active" id="f_640" title="6/40" ><a href="http://tm.stage.arcadiagroup.ltd.uk/en/tmuk/category/shoes-and-accessories-1928527/smart-shoes-140525/brogues-2681502?noOfRefinements=1" rel="nofollow" title="">6/40<span class="item_count">(21)</span></a></li> <li class="" id="f_741" title="7/41" ><a href="http://tm.stage.arcadiagroup.ltd.uk/en/tmuk/category/shoes-and-accessories-1928527/smart-shoes-140525/brogues-2681502?refinements=Shoe%20Size{1}~[6%2F40|7%2F41]&amp;noOfRefinements=3" rel="nofollow" title="">7/41<span class="item_count">(22)</span></a></li> <li class="" id="f_842" title="8/42" ><a href="http://tm.stage.arcadiagroup.ltd.uk/en/tmuk/category/shoes-and-accessories-1928527/smart-shoes-140525/brogues-2681502?refinements=Shoe%20Size{1}~[6%2F40|8%2F42]&amp;noOfRefinements=3" rel="nofollow" title="">8/42<span class="item_count">(23)</span></a></li> <li class="" id="f_943" title="9/43" ><a href="http://tm.stage.arcadiagroup.ltd.uk/en/tmuk/category/shoes-and-accessories-1928527/smart-shoes-140525/brogues-2681502?refinements=Shoe%20Size{1}~[6%2F40|9%2F43]&amp;noOfRefinements=3" rel="nofollow" title="">9/43<span class="item_count">(23)</span></a></li> <li class="" id="f_1044" title="10/44" ><a href="http://tm.stage.arcadiagroup.ltd.uk/en/tmuk/category/shoes-and-accessories-1928527/smart-shoes-140525/brogues-2681502?refinements=Shoe%20Size{1}~[10%2F44|6%2F40]&amp;noOfRefinements=3" rel="nofollow" title="">10/44<span class="item_count">(23)</span></a></li> <li class="" id="f_1145" title="11/45" ><a href="http://tm.stage.arcadiagroup.ltd.uk/en/tmuk/category/shoes-and-accessories-1928527/smart-shoes-140525/brogues-2681502?refinements=Shoe%20Size{1}~[11%2F45|6%2F40]&amp;noOfRefinements=3" rel="nofollow" title="">11/45<span class="item_count">(22)</span></a></li> <li class="" id="f_1246" title="12/46" ><a href="http://tm.stage.arcadiagroup.ltd.uk/en/tmuk/category/shoes-and-accessories-1928527/smart-shoes-140525/brogues-2681502?refinements=Shoe%20Size{1}~[12%2F46|6%2F40]&amp;noOfRefinements=3" rel="nofollow" title="">12/46<span class="item_count">(20)</span></a></li>  </ul>  </div></div><div class="block_search_filter multiSelect" id="filter_1_Colour" title="Colour"> <div class="cf">
<span class="filter_label">Colour</span><a href="http://tm.stage.arcadiagroup.ltd.uk/webapp/wcs/stores/servlet/CatalogNavigationSearchResultCmd?pageSize=20&amp;catalogId=33056&amp;viewAllFlag=false&amp;langId=-1&amp;sort_field=Relevance&amp;beginIndex=1&amp;categoryId=207294&amp;storeId=12555&amp;parent_categoryId=207282&amp;refinements=Shoe%20Size{1}~[6%2F40]^category~[1592051|207294]" class="link_clear_filter" title="Clear">Clear</a></div><div class="cf"> <ul> <li class="" id="f_black" title="black" ><a href="http://tm.stage.arcadiagroup.ltd.uk/en/tmuk/category/shoes-and-accessories-1928527/smart-shoes-140525/brogues-2681502?refinements=Colour{1}~[black]^Shoe%20Size{1}~[6%2F40]&amp;noOfRefinements=3" rel="nofollow" title="">black<span class="item_count">(9)</span></a></li> <li class="" id="f_blue" title="blue" ><a href="http://tm.stage.arcadiagroup.ltd.uk/en/tmuk/category/shoes-and-accessories-1928527/smart-shoes-140525/brogues-2681502?refinements=Colour{1}~[blue]^Shoe%20Size{1}~[6%2F40]&amp;noOfRefinements=3" rel="nofollow" title="">blue<span class="item_count">(2)</span></a></li> <li class="" id="f_brown" title="brown" ><a href="http://tm.stage.arcadiagroup.ltd.uk/en/tmuk/category/shoes-and-accessories-1928527/smart-shoes-140525/brogues-2681502?refinements=Colour{1}~[brown]^Shoe%20Size{1}~[6%2F40]&amp;noOfRefinements=3" rel="nofollow" title="">brown<span class="item_count">(10)</span></a></li>  </ul>  </div></div> </div><a href="http://tm.stage.arcadiagroup.ltd.uk/webapp/wcs/stores/servlet/CatalogNavigationSearchResultCmd?pageSize=20&amp;catalogId=33056&amp;viewAllFlag=false&amp;langId=-1&amp;sort_field=Relevance&amp;beginIndex=1&amp;categoryId=207294&amp;storeId=12555&amp;parent_categoryId=207282" class="clear_all" title="Clear All">Clear All</a><div id="espot_aside_1" class="espot">
<script type="text/javascript">

如果我使用

<form action="CatalogNavigationSearchResultCmd?">(.*?)<script type="text/javascript">

没有返回任何值。

提前致谢。

1 个答案:

答案 0 :(得分:0)

尝试使用单行或dotall选项。很多表达式可以像这样指定内联:

(?s)(.*?)