2013-10-15 175 views

回答

0

不知道,如果你想標記之間的一切,嗯,這是在未拍攝組在此:

/(<(?:link|style|script)(?:.*?)(?:\/)?>)(?:(?<=^|>)[^><]+?(?=<|$))(<\/(?:style|script)>)?/i 

我會在這個順便使用PREG_SET_ORDER標誌。 [0]是全部匹配,[1]是開始/全部,並且[2]是可選的結束標記

$string = '<link lan="hello"/><script language=\'javascript\'>$(document).ready(function() {}</script>' 
$returnValue = preg_match_all('/(<(?:link|style|script)(?:.*?)(?:\\/)?>)(?:(?<=^|>)[^><]+?(?=<|$))(<\\/(?:style|script)>)?/i', $string , $matches, PREG_SET_ORDER); 
相關問題