Sion Arrowsmith wrote:
> Duncan Booth <[EMAIL PROTECTED]> wrote:
>>Although I generally advise against overuse of regular expressions,
>>this is one situation where regular expressions might be useful: [ ...
>>]
> nobr = re.compile('\W*\W*', re.I)
>
> Agreed (on both counts), but r'\s*\s*'
Duncan Booth <[EMAIL PROTECTED]> wrote:
>Although I generally advise against overuse of regular expressions, this is
>one situation where regular expressions might be useful: [ ... ]
nobr = re.compile('\W*\W*', re.I)
Agreed (on both counts), but r'\s*\s*' might be better
(consider what happ
[EMAIL PROTECTED] wrote:
> i have some html that looks like this
>
>
> 34 main, Boston, MA
>
> and i am trying to use the replace function to get rid of the that
> i scrape out using this code:
>
> for oText in incident.fetchText( oRE):
> strTitle += oText.strip()
Why concatening
Rinzwind wrote:
>Works for me.
>
>
>
txt = "an unfortunate in the middle"
print txt.replace("", "")
>an unfortunate in the middle
>
>
>
>
>Though I don't like the 2 spaces it gives ;)
>
>
>
so use regex and replace both the double spaces and the
cheers
albert
Rinzwind wrote:
> Works for me.
>
txt = "an unfortunate in the middle"
print txt.replace("", "")
> an unfortunate in the middle
>
>
> Though I don't like the 2 spaces it gives ;)
>
Although I generally advise against overuse of regular expressions, this is
one situation wher
Works for me.
>>> txt = "an unfortunate in the middle"
>>> print txt.replace("", "")
an unfortunate in the middle
>>>
Though I don't like the 2 spaces it gives ;)
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> nope didn't work
Could you be more specific about the error? Both my example and yours
work perfectly on my box.
--
http://mail.python.org/mailman/listinfo/python-list
nope didn't work
--
http://mail.python.org/mailman/listinfo/python-list
tried that, didn't work for me
--
http://mail.python.org/mailman/listinfo/python-list
I think you want to use the replace method of the string instance.
Something like this will work:
# See http://docs.python.org/lib/string-methods.html#l2h-196
txt = "an unfortunate in the middle"
txt = txt.replace("", "")
--
http://mail.python.org/mailman/listinfo/python-list
i have some html that looks like this
34 main, Boston, MA
and i am trying to use the replace function to get rid of the that
i scrape out using this code:
for oText in incident.fetchText( oRE):
strTitle += oText.strip()
strTitle = string.replace(strTitle,'','')
but it
11 matches
Mail list logo