Python论坛  - 讨论区

标题:Re: Re: [python-chinese]问一个字符串处理问

2004年08月19日 星期四 20:32

小东 leejd at 263.net
Thu Aug 19 20:32:59 HKT 2004

guochen,您好!

	   re.sub(r'^\"',' ',a)中,单引号前面的那个r代表里面的字符串的\不转义的,你把\去掉

======= 2004-08-19 15:09:08 您在来信中写道:=======

>Zoom.Quiet,您好!
>
>replace是Python的字符串处理函数
>我是处理一些HTML文件,其中的部分连接是"/开头,读出来的时候就是"/xxxxx的形式,要把这些"删掉,只留下/xxxxx部分
>
>======= 2004-08-19 15:02:00 您在来信中写道:=======
>
>>Hollo guochen:
>>
>>  >>> a="\"fgsdfgsfdgsdf"
>>>>> a
>>'"fgsdfgsfdgsdf'
>>>>> import re
>>>>> re.sub(r'^\"',' ',a)
>>' fgsdfgsfdgsdf'
>>
>>
>>
>>FT 是Python 嘛?好象没有replace 函式的吧??
>>
>>
>>/******** [2004-08-19]15:00:10 ; guochen wrote:
>>
>>guochen> 我处理一个文件,读到里面的某个字符串,是"开头的,但是用replace('"','')却删不掉这个引号,怎么处理?
>>guochen> 请教
>>
>>
>>guochen> _______________________________________________
>>guochen> python-chinese list
>>guochen> python-chinese at lists.python.cn
>>guochen> http://python.cn/mailman/listinfo/python-chinese
>>
>>
>>********************************************/
>>
>>-- 
>>Free as in Freedom
>>
>> Zoom.Quiet                           
>>
>>#=========================================#
>>]Time is unimportant, only life important![
>>#=========================================#
>>
>>sender is the Bat!2.12.00
>>
>>_______________________________________________
>>python-chinese list
>>python-chinese at lists.python.cn
>>http://python.cn/mailman/listinfo/python-chinese
>
>= = = = = = = = = = = = = = = = = = = =
>			
>
>        致
>礼!
> 
>				 
>        guochen
>        guochen at 1218.com.cn
>          2004-08-19
>
>
>
>_______________________________________________
>python-chinese list
>python-chinese at lists.python.cn
>http://python.cn/mailman/listinfo/python-chinese

= = = = = = = = = = = = = = = = = = = =
			

        致
礼!
 
				 
        小东
        leejd at 263.net
          2004-08-19


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

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

    你的回复:

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

    Zeuux © 2025

    京ICP备05028076号