要处理的内容,如下:
----------------------------------
<SPAN onmouseover=_tipon(this) 
onmouseout=_tipoff()><SPAN class=google-src-text 
style="DIRECTION: ltr; TEXT-ALIGN: left">All these web sites tend to have the 
same elements, including:</SPAN>所有这些网站往往有相同的元素,包括:</SPAN> </P>
<P><SPAN onmouseover=_tipon(this) onmouseout=_tipoff()><SPAN 
class=google-src-text style="DIRECTION: ltr; TEXT-ALIGN: left">*Heavy sales 
tactics.</SPAN> *重销售策略。</SPAN> <BR><SPAN onmouseover=_tipon(this) 
onmouseout=_tipoff()><SPAN class=google-src-text 
style="DIRECTION: ltr; TEXT-ALIGN: left">*Plenty of text and minimal 
pictures.</SPAN> *最小的文字和图片丰盛。</SPAN> <BR><SPAN onmouseover=_tipon(this) 
onmouseout=_tipoff()><SPAN class=google-src-text 
style="DIRECTION: ltr; TEXT-ALIGN: left">*Large claims.</SPAN> *大型索赔。</SPAN> 
<BR><SPAN onmouseover=_tipon(this) onmouseout=_tipoff()><SPAN 
class=google-src-text style="DIRECTION: ltr; TEXT-ALIGN: left">*Plenty of 
testimonials – often at the start of beginning of the letter.</SPAN> *丰富的见证 - 
往往在信的开始。</SPAN> <SPAN onmouseover=_tipon(this) onmouseout=_tipoff()><SPAN 
class=google-src-text style="DIRECTION: ltr; TEXT-ALIGN: left">Some of the newer 
direct mail web sites even have video or audio podcasts of 
testimonials.</SPAN>在见证了新网站,直邮,甚至有视频或音频播客。</SPAN> 
---------------我想匹配<SPAN class=到</SPAN>之间的内容怎么做?用 <SPAN class.*</SPAN>的话,遇到换行就不行了。如,我想匹配这一句:
<SPAN class=google-src-text style="DIRECTION: ltr; TEXT-ALIGN: left">Some of the newer 
direct mail web sites even have video or audio podcasts of 
testimonials.</SPAN>
我是想去掉英文内容。

解决方案 »

  1.   


    var str='<SPAN class=google-src-text style="DIRECTION: ltr; TEXT-ALIGN: left">Some o<f the newer \
    direct mail web sites even have video or audio podcasts of \
    testimonials. </SPAN><SPAN class=google-src-text style="DIRECTION: ltr; TEXT-ALIGN: left">Some o<f the newer \
    direct mail web sites even have video or audio podcasts of \
    testimonials. </SPAN>';
    var reg = /(<span[^>]*>)[\s\S]*?(<\/span>)/ig;
    str = str.replace(reg,'$1$2');
    alert(str)
      

  2.   

    .* -> [\s\S]*?很好,非常地谢谢。