开发者

match a regular expression to get attribute

开发者 https://www.devze.com 2023-04-08 04:46 出处:网络
I\'m already so desperate with this one. I need to be able to match the following pieces of text but:

I'm already so desperate with this one. I need to be able to match the following pieces of text but:

1) despite of any garbage before the text staveb and 2) I need to match every <OPTION ....</OPTION> with occurence of the text staveb

that means, I need to match these pieces of text:

<OPTION value="39">  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Stavebníctvo</OPTION>
 <OPTION value="39">staveb</OPTION>
 <OPTION value="39">staveb</OPTION>

from this text:

<OPTION value="25"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Anglicky</O开发者_如何学JAVAPTION> <OPTION value="19">Auto, moto</OPTION> **<OPTION value="39">  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Stavebníctvo</OPTION>**   <OPTION value="26">Školstvo</OPTION>
 **<OPTION value="39">staveb</OPTION>**

Pleease help!


try this:

<OPTION\s+value="\d+">[^>]*staveb[^<]*</OPTION>
0

精彩评论

暂无评论...
验证码 换一张
取 消