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,
where first
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 new group
.
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
.
I want to
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 (iv) In
this group
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 Jun 15, 3:55 pm, Mark Lawrence breamore...@yahoo.co.uk 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
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 stdin, line 1, in module
TypeError: list indices must be integers, not tuple
So why would the OP want
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
--
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
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]
Bugger! That last
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
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,
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.
Start here
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
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 group
.
I
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 group
(v) In this group
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
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 your links
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 from my
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:
Links
On 15 June 2013 11:18, Mark Lawrence breamore...@yahoo.co.uk wrote:
I tend to reach for string methods rather than an RE so will something like
this suit you?
c:\Users\Mark\MyPythontype a.py
for s in (In the ocean,
On the ocean,
By the ocean,
In this group,
On 15/06/2013 22:03, Joshua Landau wrote:
On 15 June 2013 11:18, Mark Lawrence breamore...@yahoo.co.uk wrote:
I tend to reach for string methods rather than an RE so will something like
this suit you?
c:\Users\Mark\MyPythontype a.py
for s in (In the ocean,
On the ocean,
22 matches
Mail list logo