On 15/06/2013 22:03, Joshua Landau wrote:
On 15 June 2013 11:18, Mark Lawrence wrote:
I tend to reach for string methods rather than an RE so will something like
this suit you?
c:\Users\Mark\MyPython>type a.py
for s in ("In the ocean",
"On the ocean",
"By the ocean",
On 15 June 2013 11:18, Mark Lawrence wrote:
> I tend to reach for string methods rather than an RE so will something like
> this suit you?
>
> c:\Users\Mark\MyPython>type a.py
> for s in ("In the ocean",
> "On the ocean",
> "By the ocean",
> "In this group",
>
Oops...
On Saturday, June 15, 2013 12:47:18 PM UTC-6, ru...@yahoo.com wrote:
> Links to the Python reference documentation are useful for people
> just beginning with some aspect of Python; they are for people who
> already know Python and want to look up details.
That was supposed to be:
Link
On 6/15/2013 12:28 PM, subhabangal...@gmail.com wrote:
Suppose I want a regular expression that matches both "Sent from my iPhone" and
"Sent from my iPod". How do I write such an expression--is the problem,
"Sent from my iPod"
"Sent from my iPhone"
which can be written as,
re.compile("Sent fro
On Sunday, June 16, 2013 12:17:18 AM UTC+5:30, ru...@yahoo.com wrote:
> On Saturday, June 15, 2013 11:54:28 AM UTC-6, subhaba...@gmail.com wrote:
>
>
>
> > Thank you for the answer. But I want to learn bit of interesting
>
> > regular expression forms where may I?
>
> > No Mark, thank you for
On Saturday, June 15, 2013 11:54:28 AM UTC-6, subhaba...@gmail.com wrote:
> Thank you for the answer. But I want to learn bit of interesting
> regular expression forms where may I?
> No Mark, thank you for your links but they were not sufficient.
Links to the Python reference documentation are u
On Saturday, June 15, 2013 3:12:55 PM UTC+5:30, subhaba...@gmail.com wrote:
> Dear Group,
>
>
>
> I am trying to search the following pattern in Python.
>
>
>
> I have following strings:
>
>
>
> (i)"In the ocean"
>
> (ii)"On the ocean"
>
> (iii) "By the ocean"
>
> (iv) "In this grou
On 06/15/2013 03:42 AM, subhabangal...@gmail.com wrote:> Dear Group,
>
> I am trying to search the following pattern in Python.
>
> I have following strings:
>
> (i)"In the ocean"
> (ii)"On the ocean"
> (iii) "By the ocean"
> (iv) "In this group"
> (v) "In this group"
> (vi) "By the new gr
On 15/06/2013 17:28, subhabangal...@gmail.com wrote:
You've been pointed at several links, so what have you tried, and what,
if anything, went wrong? Or do you simply not understand, in which case
please say so and we'll help. I'm not trying to be awkward, it's simply
known that you learn mo
On Saturday, June 15, 2013 8:34:59 PM UTC+5:30, Mark Lawrence wrote:
> On 15/06/2013 15:31, subhabangal...@gmail.com wrote:
>
> >
>
> > Dear Group,
>
> >
>
> > I know this solution but I want to have Regular Expression option. Just
> > learning.
>
> >
>
> > Regards,
>
> > Subhabrata.
>
> >
On 15/06/2013 15:31, subhabangal...@gmail.com wrote:
Dear Group,
I know this solution but I want to have Regular Expression option. Just
learning.
Regards,
Subhabrata.
Start here http://docs.python.org/2/library/re.html
Would you also please read and action this,
http://wiki.python.org/m
subhabangal...@gmail.com wrote:
>I know this solution but I want to have Regular Expression option.
>Just learning.
http://mattgemmell.com/2008/12/08/what-have-you-tried/
Just spell out what you want:
A word at the beginning, followed by any text, followed by a word at
the end.
Now look up the ba
On Saturday, June 15, 2013 7:58:44 PM UTC+5:30, Mark Lawrence wrote:
> On 15/06/2013 14:45, Denis McMahon wrote:
>
> > On Sat, 15 Jun 2013 13:41:21 +, Denis McMahon wrote:
>
> >
>
> >> first_and_last = [sentence.split()[i] for i in (0, -1)] middle =
>
> >> sentence.split()[1:-2]
>
> >
>
>
On 15/06/2013 14:45, Denis McMahon wrote:
On Sat, 15 Jun 2013 13:41:21 +, Denis McMahon wrote:
first_and_last = [sentence.split()[i] for i in (0, -1)] middle =
sentence.split()[1:-2]
Bugger! That last is actually:
sentence.split()[1:-1]
It just looks like a two.
I've a very strong se
On Sat, 15 Jun 2013 13:41:21 +, Denis McMahon wrote:
> first_and_last = [sentence.split()[i] for i in (0, -1)] middle =
> sentence.split()[1:-2]
Bugger! That last is actually:
sentence.split()[1:-1]
It just looks like a two.
--
Denis McMahon, denismfmcma...@gmail.com
--
http://mail.pytho
On Sat, 15 Jun 2013 11:55:34 +0100, Mark Lawrence wrote:
> >>> sentence = "By the new group"
> >>> words = sentence.split()
> >>> words[words[0],words[-1]]
> Traceback (most recent call last):
>File "", line 1, in
> TypeError: list indices must be integers, not tuple
>
> So why would the
On Jun 15, 3:55 pm, Mark Lawrence wrote:
> On 15/06/2013 11:24, Denis McMahon wrote:
>
>
>
>
>
>
>
>
>
> > On Sat, 15 Jun 2013 10:05:01 +, Steven D'Aprano wrote:
>
> >> On Sat, 15 Jun 2013 02:42:55 -0700, subhabangalore wrote:
>
> >>> Dear Group,
>
> >>> I am trying to search the following pat
On 15/06/2013 11:24, Denis McMahon wrote:
On Sat, 15 Jun 2013 10:05:01 +, Steven D'Aprano wrote:
On Sat, 15 Jun 2013 02:42:55 -0700, subhabangalore wrote:
Dear Group,
I am trying to search the following pattern in Python.
I have following strings:
(i)"In the ocean" (ii)"On the ocean"
On Sat, 15 Jun 2013 10:05:01 +, Steven D'Aprano wrote:
> On Sat, 15 Jun 2013 02:42:55 -0700, subhabangalore wrote:
>
>> Dear Group,
>>
>> I am trying to search the following pattern in Python.
>>
>> I have following strings:
>>
>> (i)"In the ocean" (ii)"On the ocean" (iii) "By the ocean"
On 15/06/2013 10:42, subhabangal...@gmail.com wrote:
Dear Group,
I am trying to search the following pattern in Python.
I have following strings:
(i)"In the ocean"
(ii)"On the ocean"
(iii) "By the ocean"
(iv) "In this group"
(v) "In this group"
(vi) "By the new group"
.
On Sat, 15 Jun 2013 02:42:55 -0700, subhabangalore wrote:
> Dear Group,
>
> I am trying to search the following pattern in Python.
>
> I have following strings:
>
> (i)"In the ocean"
> (ii)"On the ocean"
> (iii) "By the ocean"
> (iv) "In this group"
> (v) "In this group"
> (vi) "By the ne
Dear Group,
I am trying to search the following pattern in Python.
I have following strings:
(i)"In the ocean"
(ii)"On the ocean"
(iii) "By the ocean"
(iv) "In this group"
(v) "In this group"
(vi) "By the new group"
.
I want to extract from the first word to the last word,
whe
22 matches
Mail list logo