87,997
社区成员




<P style="TEXT-ALIGN: center; LINE-HEIGHT: 55pt; mso-line-height-rule: exactly" class=MsoNormal align=center><SPAN style="FONT-FAMILY: 华文新魏; LETTER-SPACING: -5pt; COLOR: red; FONT-SIZE: 43pt; mso-font-kerning: 5.0pt">能在自己的航海图上标注上之前成功的船队的航行路线<SPAN lang=EN-US><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></SPAN></P>
var re = /^LETTER-SPACING\:\s*(\-?\d)pt$/g;
var str='<P style="TEXT-ALIGN: center; LINE-HEIGHT: 55pt; mso-line-height-rule: exactly" class=MsoNormal align=center><SPAN style="FONT-FAMILY: 华文新魏; LETTER-SPACING: 5pt; COLOR: red; FONT-SIZE: 43pt; mso-font-kerning: 5.0pt">能在自己的航海图上标注上之前成功的船队的航行路线<SPAN lang=EN-US><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></SPAN></P>';
str = str.replace(re,function(){
return "LETTER-SPACING:" + 2*parseInt(arguments[1]) + "pt"
});
alert(str);
javascript:
var strObj='<P style="TEXT-ALIGN: center; LINE-HEIGHT: 55pt; mso-line-height-rule: exactly" class=MsoNormal align=center><SPAN style="FONT-FAMILY: 华文新魏; LETTER-SPACING: -5.2pt; COLOR: red; FONT-SIZE: 43pt; mso-font-kerning: 5.0pt">能在自己的航海图上标注上之前成功的船队的航行路线<SPAN lang=EN-US><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></SPAN></P>';
alert(strObj.replace(/(LETTER-SPACING\:\s*[+-]?)([\d\.]{1,})pt\;/gi,function(){return arguments[1]+(Number(arguments[2])*2)+'pt\;';})); void(0);
var str = '<P style="TEXT-ALIGN: center; LINE-HEIGHT: 55pt; mso-line-height-rule: exactly" class=MsoNormal align=center><SPAN style="FONT-FAMILY: 华文新魏; LETTER-SPACING: -5pt; COLOR: red; FONT-SIZE: 43pt; mso-font-kerning: 5.0pt">能在自己的航海图上标注上之前成功的船队的航行路线<SPAN lang=EN-US><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></SPAN></P>';
var str1 = str.replace(/LETTER-SPACING:\s*(-?\d*)/gi,function(a,p1){return 'LETTER-SPACING:'+Number(p1)*2});
alert(str1);
var strObj='<P style="TEXT-ALIGN: center; LINE-HEIGHT: 55pt; mso-line-height-rule: exactly" class=MsoNormal align=center><SPAN style="FONT-FAMILY: 华文新魏; LETTER-SPACING: -5pt; COLOR: red; FONT-SIZE: 43pt; mso-font-kerning: 5.0pt">能在自己的航海图上标注上之前成功的船队的航行路线<SPAN lang=EN-US><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></SPAN></P>';
alert(strObj.replace(/(LETTER-SPACING\:\s*[+-]?)(\d{1,})pt/gi,function(){ return arguments[1]+parseInt(arguments[2])*2 + 'pt'; }));
var str = '<P style="TEXT-ALIGN: center; LINE-HEIGHT: 55pt; mso-line-height-rule: exactly" class=MsoNormal align=center><SPAN style="FONT-FAMILY: 华文新魏; LETTER-SPACING: -5pt; COLOR: red; FONT-SIZE: 43pt; mso-font-kerning: 5.0pt">能在自己的航海图上标注上之前成功的船队的航行路线<SPAN lang=EN-US><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></SPAN></P>'
var rule = /LETTER-SPACING\:\s*(\-?\d)pt/g;
rst = str.replace(rule,function(){
alert(arguments[1]);
return "LETTER-SPACING:" + 2*parseInt(arguments[1]) + "pt"
});
alert(rst);
var re = /^LETTER-SPACING\:\s*(\-?\d)pt$/g;
var str = 'LETTER-SPACING: -5pt';
str = str.replace(re,function(){
return "LETTER-SPACING:" + 2*parseInt(arguments[1]) + "pt"
});
alert(str);