En Sat, 24 Jan 2009 19:03:26 -0200, Sean Brown gmail.com>
<" escribió:
Using python 2.4.4 on OpenSolaris 2008.11
I have the following string created by opening a url that has the
following string in it:
td[ct] = [[ ... ]];\r\n
The ... above is what I'm interested in extracting which is rea
On Jan 25, 5:59 am, Scott David Daniels wrote:
> Sean Brown wrote:
> > I have the following string ...: "td[ct] = [[ ... ]];\r\n"
> > The ... (representing text in the string) is what I'm extracting
> > So I think the regex \[\[(.*)\]\]; should do it.
> > The problem is it appears that pytho
Roy Smith wrote:
[snip]
Another trick when you're not 100% what you're looking at is to
explode the string like this:
[c for c in reg]
> ['\\', '[', '\\', '[', '(', '.', '*', ')', '\\', ']', '\\', ']', ';']
>
A shorter way is list(reg).
--
http://mail.python.org/mailman/listinfo/python-lis
Sean Brown wrote:
I have the following string ...: "td[ct] = [[ ... ]];\r\n"
The ... (representing text in the string) is what I'm extracting
So I think the regex \[\[(.*)\]\]; should do it.
The problem is it appears that python is escaping the \ in the regex
because I see this:
reg = '\[\
Sean Brown wrote:
> The problem is it appears that python is escaping the \ in the regex
> because I see this:
> >>>reg = '\[\[(.*)\]\];'
The first trick of working with regexes in Python is to *always* use raw
strings. Instead of
reg = '\[\[(.*)\]\];'
you want
reg = r'\[\[(.*)\]\];'
In th
Mark Tolonen wrote:
>
> "Sean Brown" wrote in message
> news:glflaj$qr...@nntp.motzarella.org...
>> Using python 2.4.4 on OpenSolaris 2008.11
>>
>> I have the following string created by opening a url that has the
>> following string in it:
>>
>> td[ct] = [[ ... ]];\r\n
>>
>> The ... above is wh
"Sean Brown" wrote in message
news:glflaj$qr...@nntp.motzarella.org...
Using python 2.4.4 on OpenSolaris 2008.11
I have the following string created by opening a url that has the
following string in it:
td[ct] = [[ ... ]];\r\n
The ... above is what I'm interested in extracting which is rea
Using python 2.4.4 on OpenSolaris 2008.11
I have the following string created by opening a url that has the
following string in it:
td[ct] = [[ ... ]];\r\n
The ... above is what I'm interested in extracting which is really a
whole bunch of text. So I think the regex \[\[(.*)\]\]; should do it.