sex123 发表于 2014-7-29 09:45:36

如何判断正则是否在指定位置出现?

http://www.ncbi.nlm.nih.gov/pubmed/23511345
源代码中,有两个icon for 分别代表两个图标,第一个图标点进去是收费的,所以,第一个icon for 前面一行代码中没有free_status ,而第二个图标,点进去是免费的,所以,第二个icon for 前面有free_status字样,我想问的是,如何判断第一个icon for 前面有没有free_status?


<div class="icons"><a href="http://linkinghub.elsevier.com/retrieve/pii/S0891-4222(13)00092-9" ref="PrId=3048&amp;itool=Abstract-def&amp;uid=23511345&amp;nlmid=8709782&amp;db=pubmed&amp;log$=linkouticon&amp;ftext_icon_expt=fulltext4" journal="Res Dev Disabil" target="_blank"><img alt="Icon for Elsevier Science" title="Read full text in Elsevier Science" src="//www.ncbi.nlm.nih.gov/corehtml/query/egifs/http:--linkinghub.elsevier.com-ihub-images-PubMedLink.gif" border="0" /></a> <a href="http://www.ncbi.nlm.nih.gov/pmc/articles/pmid/23511345/" ref="PrId=3494&amp;itool=Abstract-nondef&amp;uid=23511345&amp;nlmid=8709782&amp;db=pubmed&amp;log$=linkouticon&amp;ftext_icon_expt=fulltext4" free_status="free" journal="Res Dev Disabil" target="_blank"><img alt="Icon for PubMed Central" title="Read full text in PubMed Central" src="//www.ncbi.nlm.nih.gov/corehtml/query/egifs/http:--www.pubmedcentral.nih.gov-corehtml-pmc-pmcgifs-pubmed-pmc-MS.gif" border="0" /></a> </div>
页: [1]
查看完整版本: 如何判断正则是否在指定位置出现?