0
我有一个像使用正则表达式解析
some text [http://abc.com/a.jpg] here will be long text
can be multiple line breaks again [http://a.com/a.jpg] here will be other text
blah blah
一些文字,我需要转换成
<div>some text</div><img src="http://abc.com/a.jpg"/><div>here will be long text
can be multiple line breaks again</div><img src="http://a.com/a.jpg"/><div>here will be other text
blah blah</div>
要获得<img>
标签,我换成\[(.*?)\]
与<img src="$1"/>
,导致
some text<img src="http://abc.com/a.jpg"/>here will be long text
can be multiple enters again<img src="http://a.com/a.jpg"/>here will be other text
blah blah
但是,我不知道如何包装文本在<div>
。
我在iPhone上做的一切与RegexKitLite
谢谢:)但是任何其他的想法将是很好的替换所有
\[(.*?)\]
出现。因为我已经在使用这个逻辑了。 – 2011-06-15 01:34:24