- <script>
- var str="我不...不...不是...是结...结...结巴...巴"
- alert(str.replace(/(.)(/.+/1)+/g,"$1"));
- </script>
- <script>
- function f2c(s) {
- var test = /(/d+(/./d*)?)F/b/g; // 初始化模式。
- return(s.replace
- (test,
- function($0,$1,$2) {
- return((($1-32) * 5/9) + "C");
- }
- )
- );
- }
- document.write(f2c("Water freezes at 32F and boils at 212F."));
- </script>
新闻热点
疑难解答