Php:删除多个子标签(脚本)

时间:2017-04-30 02:53:46

标签: php domdocument

需要查找包含条件的单个<script> condition </script>。 下面的示例包含4个标记,我需要匹配包含条件的第二个标记并丢弃其他标记。从<script>开始。在条件可以是空格或新行之前,而不是if (window.location.href == bar) { }之类的条件,而不是空格或新行,以及结束</script>

<script>                  <!-- discard --->
other stuff
not to be found
</script>                 


<script>                  <!-- MATCH --->

if (window.location.href == bar) {         
do something                 
}

</script>                

<script>                 <!-- discard --->
other stuff
not to be found
</script>                

<script>                 <!-- discard --->
other stuff
not to be found
</script>

提前致谢

1 个答案:

答案 0 :(得分:0)

您应该使用typedef struct m{ struct m *next; struct m *previous; int data; } m_r, *m_p; 代替 lvVenue.setOnItemClickListener(new AdapterView.OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { GetVenue getVenue = venuelist.get(position);//using position int get correspondig data Intent appInfo = new Intent(MainMenu.this, VenueActivity.class); startActivity(appInfo); } }); 来匹配代码及其所需内容。

Try this code snippet here

DOMDocument