Created
June 26, 2014 14:08
-
-
Save jikeytang/39b3aacbd5ce3f29a323 to your computer and use it in GitHub Desktop.
[ Javascript ] - 20140627-题目1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
请把“[img111],[img222]”替换为“<img src="111.jpg"/>,<img src="222.jpg"/>”。 | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 | |
```javascript | |
// you code | |
``` | |
2. 粘贴代码时请使用shift+tab,缩进前面的空白。 |
tanxingxing
commented
Jun 27, 2014
var str = '[img111],[img222]';
alert(str.replace(/\[img/g,'<img src="').replace(/\]/g, '.ipg"/>'));
正则还没完全学完,只能用最简单的弄出来了
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment