Python论坛  - 讨论区

标题:[python-chinese] 怎么快速提取字符串中特定字符

2007年12月28日 星期五 17:40

Youhong Han python.han在gmail.com
星期五 十二月 28 17:40:37 HKT 2007

Ò»×Ö·û´®ÀàËÆÏÂÃ涫Î÷£º

sadf ddd ddd asdf ddd asdf

Ïë°Ñsrc="/media/upload/fckeditor/Image/DSC_3009_stand.JPG" µÈ¶«Î÷¿ìËÙÌáÈ¡³öÀ´£¬ÓÐʲôÏֳɵĺð취£¿ -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20071228/623daf3e/attachment.html

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年12月28日 星期五 17:43

Zoom.Quiet zoom.quiet在gmail.com
星期五 十二月 28 17:43:15 HKT 2007

On Dec 28, 2007 5:40 PM, Youhong Han <python.han在gmail.com> wrote:
> 一字符串类似下面东西:
> 
>

sadf

> ddd> src="/media/upload/fckeditor/Image/DSC_3009_stand.JPG" /> > ddd> src="/media/upload/fckeditor/Image/DSC_3009_stand.JPG" /> > > asdf > ddd> src="/mediaddd/upload/fckeditor/Image/DSC_3009_stand.JPG" /> > asdf > > > > 想把src="/media/upload/fckeditor/Image/DSC_3009_stand.JPG" > 等东西快速提取出来,有什么现成的好办法? > 正则表达式 > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > -- '''Time is unimportant, only life important! 过程改进乃是开始催生可促生靠谱的人的组织! '''http://zoomquiet.org 博 @ http://blog.zoomquiet.org/pyblosxom/ 维 @ http://wiki.woodpecker.org.cn/moin/ZoomQuiet 豆 @ http://www.douban.com/people/zoomq/ 看 @ http://zoomq.haokanbu.com/ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Pls. usage OOo to replace M$ Office. http://zh.openoffice.org Pls. usage 7-zip to replace WinRAR/WinZip. http://7-zip.org You can get the truely Freedom 4 software.

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年12月28日 星期五 18:18

Liming_Do Liming_Do在smics.com
星期五 十二月 28 18:18:13 HKT 2007

正则熟悉用re,不熟悉也可以使用BeautifulSoup

>>> html = '''

sadf ddd ddd asdf ddd asdf

''' >>> from BeautifulSoup import BeautifulSoup as Soup >>> soup = Soup(html) >>> imgs = soup('img') >>> for img in imgs: print img['src'] /media/upload/fckeditor/Image/DSC_3009_stand.JPG /media/upload/fckeditor/Image/DSC_3009_stand.JPG /mediaddd/upload/fckeditor/Image/DSC_3009_stand.JPG -----Original Message----- From: python-chinese-bounces在lists.python.cn [mailto:python-chinese-bounces在lists.python.cn]On Behalf Of Zoom.Quiet Sent: Friday, December 28, 2007 5:43 PM To: python-chinese在lists.python.cn Subject: Re: [python-chinese]怎么快速提取字符串中特定字符 On Dec 28, 2007 5:40 PM, Youhong Han <python.han在gmail.com> wrote: > 一字符串类似下面东西: >
>

sadf

> ddd> src="/media/upload/fckeditor/Image/DSC_3009_stand.JPG" /> > ddd> src="/media/upload/fckeditor/Image/DSC_3009_stand.JPG" /> > > asdf > ddd> src="/mediaddd/upload/fckeditor/Image/DSC_3009_stand.JPG" /> > asdf > > > > 想把src="/media/upload/fckeditor/Image/DSC_3009_stand.JPG" > 等东西快速提取出来,有什么现成的好办法? > 正则表达式 > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > -- '''Time is unimportant, only life important! 过程改进乃是开始催生可促生靠谱的人的组织! '''http://zoomquiet.org 博 @ http://blog.zoomquiet.org/pyblosxom/ 维 @ http://wiki.woodpecker.org.cn/moin/ZoomQuiet 豆 @ http://www.douban.com/people/zoomq/ 看 @ http://zoomq.haokanbu.com/ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Pls. usage OOo to replace M$ Office. http://zh.openoffice.org Pls. usage 7-zip to replace WinRAR/WinZip. http://7-zip.org You can get the truely Freedom 4 software. _______________________________________________ python-chinese Post: send python-chinese在lists.python.cn Subscribe: send subscribe to python-chinese-request在lists.python.cn Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn Detail Info: http://python.cn/mailman/listinfo/python-chinese

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2024

    京ICP备05028076号