Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #48274 > unrolled thread
| Started by | subhabangalore@gmail.com |
|---|---|
| First post | 2013-06-15 02:42 -0700 |
| Last post | 2013-06-15 22:26 +0100 |
| Articles | 20 on this page of 22 — 9 participants |
Back to article view | Back to comp.lang.python
Pattern Search Regular Expression subhabangalore@gmail.com - 2013-06-15 02:42 -0700
Re: Pattern Search Regular Expression Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-15 10:05 +0000
Re: Pattern Search Regular Expression Denis McMahon <denismfmcmahon@gmail.com> - 2013-06-15 10:24 +0000
Re: Pattern Search Regular Expression Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-06-15 11:55 +0100
Re: Pattern Search Regular Expression rusi <rustompmody@gmail.com> - 2013-06-15 04:28 -0700
Re: Pattern Search Regular Expression Denis McMahon <denismfmcmahon@gmail.com> - 2013-06-15 13:41 +0000
Re: Pattern Search Regular Expression Denis McMahon <denismfmcmahon@gmail.com> - 2013-06-15 13:45 +0000
Re: Pattern Search Regular Expression Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-06-15 15:28 +0100
Re: Pattern Search Regular Expression subhabangalore@gmail.com - 2013-06-15 07:31 -0700
Re: Pattern Search Regular Expression Andreas Perstinger <andipersti@gmail.com> - 2013-06-15 17:01 +0200
Re: Pattern Search Regular Expression Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-06-15 16:04 +0100
Re: Pattern Search Regular Expression subhabangalore@gmail.com - 2013-06-15 09:28 -0700
Re: Pattern Search Regular Expression Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-06-15 17:39 +0100
Re: Pattern Search Regular Expression Terry Reedy <tjreedy@udel.edu> - 2013-06-15 16:24 -0400
Re: Pattern Search Regular Expression Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-06-15 11:18 +0100
Re: Pattern Search Regular Expression rurpy@yahoo.com - 2013-06-15 09:59 -0700
Re: Pattern Search Regular Expression subhabangalore@gmail.com - 2013-06-15 10:54 -0700
Re: Pattern Search Regular Expression rurpy@yahoo.com - 2013-06-15 11:47 -0700
Re: Pattern Search Regular Expression subhabangalore@gmail.com - 2013-06-15 12:38 -0700
Re: Pattern Search Regular Expression rurpy@yahoo.com - 2013-06-15 13:41 -0700
Re: Pattern Search Regular Expression Joshua Landau <joshua.landau.ws@gmail.com> - 2013-06-15 22:03 +0100
Re: Pattern Search Regular Expression Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-06-15 22:26 +0100
Page 1 of 2 [1] 2 Next page →
| From | subhabangalore@gmail.com |
|---|---|
| Date | 2013-06-15 02:42 -0700 |
| Subject | Pattern Search Regular Expression |
| Message-ID | <afd6b280-3b64-467b-a2e1-2b36377cd13a@googlegroups.com> |
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 word and last word are varying.
I am looking to extract out:
(i) the
(ii) the
(iii) the
(iv) this
(v) this
(vi) the new
.....
The problem may be handled by converting the string to list and then
index of list.
But I am thinking if I can use regular expression in Python.
If any one of the esteemed members can help.
Thanking you in Advance,
Regards,
Subhabrata
[toc] | [next] | [standalone]
| From | Steven D'Aprano <steve+comp.lang.python@pearwood.info> |
|---|---|
| Date | 2013-06-15 10:05 +0000 |
| Message-ID | <51bc3c4d$0$29997$c3e8da3$5496439d@news.astraweb.com> |
| In reply to | #48274 |
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" > ..... > > I want to extract from the first word to the last word, where first word > and last word are varying. > > I am looking to extract out: > (i) the > (ii) the > (iii) the > (iv) this > (v) this > (vi) the new > ..... > > The problem may be handled by converting the string to list and then > index of list. No need for a regular expression. py> sentence = "By the new group" py> words = sentence.split() py> words[1:-1] ['the', 'new'] Does that help? -- Steven
[toc] | [prev] | [next] | [standalone]
| From | Denis McMahon <denismfmcmahon@gmail.com> |
|---|---|
| Date | 2013-06-15 10:24 +0000 |
| Message-ID | <kphfdr$su9$8@dont-email.me> |
| In reply to | #48278 |
On Sat, 15 Jun 2013 10:05:01 +0000, 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" (v) "In this group" (vi) "By the new group" >> ..... >> >> I want to extract from the first word to the last word, where first >> word and last word are varying. >> >> I am looking to extract out: >> (i) the (ii) the (iii) the (iv) this (v) this (vi) the new >> ..... >> >> The problem may be handled by converting the string to list and then >> index of list. > > No need for a regular expression. > > py> sentence = "By the new group" > py> words = sentence.split() > py> words[1:-1] > ['the', 'new'] > > Does that help? I thought OP wanted: words[words[0],words[-1]] But that might be just my caffeine deprived misinterpretation of his terminology. -- Denis McMahon, denismfmcmahon@gmail.com
[toc] | [prev] | [next] | [standalone]
| From | Mark Lawrence <breamoreboy@yahoo.co.uk> |
|---|---|
| Date | 2013-06-15 11:55 +0100 |
| Message-ID | <mailman.3371.1371293740.3114.python-list@python.org> |
| In reply to | #48281 |
On 15/06/2013 11:24, Denis McMahon wrote: > On Sat, 15 Jun 2013 10:05:01 +0000, 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" (v) "In this group" (vi) "By the new group" >>> ..... >>> >>> I want to extract from the first word to the last word, where first >>> word and last word are varying. >>> >>> I am looking to extract out: >>> (i) the (ii) the (iii) the (iv) this (v) this (vi) the new >>> ..... >>> >>> The problem may be handled by converting the string to list and then >>> index of list. >> >> No need for a regular expression. >> >> py> sentence = "By the new group" >> py> words = sentence.split() >> py> words[1:-1] >> ['the', 'new'] >> >> Does that help? > > I thought OP wanted: > > words[words[0],words[-1]] > > But that might be just my caffeine deprived misinterpretation of his > terminology. > >>> 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 a TypeError? Or has caffeine deprivation affected your typing skills? :) -- "Steve is going for the pink ball - and for those of you who are watching in black and white, the pink is next to the green." Snooker commentator 'Whispering' Ted Lowe. Mark Lawrence
[toc] | [prev] | [next] | [standalone]
| From | rusi <rustompmody@gmail.com> |
|---|---|
| Date | 2013-06-15 04:28 -0700 |
| Message-ID | <b663cb48-39eb-4df7-81af-0f957fa5d54b@ks18g2000pbb.googlegroups.com> |
| In reply to | #48282 |
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 +0000, 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" (v) "In this group" (vi) "By the new group" > >>> ..... > > >>> I want to extract from the first word to the last word, where first > >>> word and last word are varying. > > >>> I am looking to extract out: > >>> (i) the (ii) the (iii) the (iv) this (v) this (vi) the new > >>> ..... > > >>> The problem may be handled by converting the string to list and then > >>> index of list. > > >> No need for a regular expression. > > >> py> sentence = "By the new group" > >> py> words = sentence.split() > >> py> words[1:-1] > >> ['the', 'new'] > > >> Does that help? > > > I thought OP wanted: > > > words[words[0],words[-1]] > > > But that might be just my caffeine deprived misinterpretation of his > > terminology. > > >>> 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 a TypeError? Or has caffeine deprivation > affected your typing skills? :) :-) I guess Denis meant (words[0], words[-1]) To the OP: You have the identity: words == [words[0]] + words[1:-1] + [words[-1]] So take your pick of what parts of the expression you want (and discard what you dont want). [The way you've used 'extract' is a bit ambiguous]
[toc] | [prev] | [next] | [standalone]
| From | Denis McMahon <denismfmcmahon@gmail.com> |
|---|---|
| Date | 2013-06-15 13:41 +0000 |
| Message-ID | <kphqu1$su9$10@dont-email.me> |
| In reply to | #48282 |
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 a TypeError? Or has caffeine deprivation > affected your typing skills? :) Yeah - that last: words[words[0],words[-1]] should probably have been: first_and_last = [words[0], words[-1]] or even: first_and_last = (words[0], words[-1]) Or even: first_and_last = [sentence.split()[i] for i in (0, -1)] middle = sentence.split()[1:-2] -- Denis McMahon, denismfmcmahon@gmail.com
[toc] | [prev] | [next] | [standalone]
| From | Denis McMahon <denismfmcmahon@gmail.com> |
|---|---|
| Date | 2013-06-15 13:45 +0000 |
| Message-ID | <kphr62$su9$11@dont-email.me> |
| In reply to | #48296 |
On Sat, 15 Jun 2013 13:41:21 +0000, 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, denismfmcmahon@gmail.com
[toc] | [prev] | [next] | [standalone]
| From | Mark Lawrence <breamoreboy@yahoo.co.uk> |
|---|---|
| Date | 2013-06-15 15:28 +0100 |
| Message-ID | <mailman.3377.1371306538.3114.python-list@python.org> |
| In reply to | #48297 |
On 15/06/2013 14:45, Denis McMahon wrote: > On Sat, 15 Jun 2013 13:41:21 +0000, 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 sense of deja vu having round the same loop what, two hours ago? Wondering out aloud the number of times a programmer has thought "That's easy, I don't need to test it". How are the mighty fallen. -- "Steve is going for the pink ball - and for those of you who are watching in black and white, the pink is next to the green." Snooker commentator 'Whispering' Ted Lowe. Mark Lawrence
[toc] | [prev] | [next] | [standalone]
| From | subhabangalore@gmail.com |
|---|---|
| Date | 2013-06-15 07:31 -0700 |
| Message-ID | <5200649f-2b2f-4535-8016-a31369e6e348@googlegroups.com> |
| In reply to | #48300 |
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 +0000, 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 sense of deja vu having round the same loop what, two > > hours ago? Wondering out aloud the number of times a programmer has > > thought "That's easy, I don't need to test it". How are the mighty fallen. > > > > -- > > "Steve is going for the pink ball - and for those of you who are > > watching in black and white, the pink is next to the green." Snooker > > commentator 'Whispering' Ted Lowe. > > > > Mark Lawrence Dear Group, I know this solution but I want to have Regular Expression option. Just learning. Regards, Subhabrata.
[toc] | [prev] | [next] | [standalone]
| From | Andreas Perstinger <andipersti@gmail.com> |
|---|---|
| Date | 2013-06-15 17:01 +0200 |
| Message-ID | <mailman.3379.1371308512.3114.python-list@python.org> |
| In reply to | #48301 |
subhabangalore@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 basic regex metacharacters and try to come up with a solution (Hint: you will need groups) http://docs.python.org/3/howto/regex.html#regex-howto http://docs.python.org/3/library/re.html#regular-expression-syntax Bye, Andreas
[toc] | [prev] | [next] | [standalone]
| From | Mark Lawrence <breamoreboy@yahoo.co.uk> |
|---|---|
| Date | 2013-06-15 16:04 +0100 |
| Message-ID | <mailman.3380.1371308712.3114.python-list@python.org> |
| In reply to | #48301 |
On 15/06/2013 15:31, subhabangalore@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/moin/GoogleGroupsPython , thanks. -- "Steve is going for the pink ball - and for those of you who are watching in black and white, the pink is next to the green." Snooker commentator 'Whispering' Ted Lowe. Mark Lawrence
[toc] | [prev] | [next] | [standalone]
| From | subhabangalore@gmail.com |
|---|---|
| Date | 2013-06-15 09:28 -0700 |
| Message-ID | <2f83304f-8b4c-4af5-9fea-ec894a1b6401@googlegroups.com> |
| In reply to | #48307 |
On Saturday, June 15, 2013 8:34:59 PM UTC+5:30, Mark Lawrence wrote:
> On 15/06/2013 15:31, subhabangalore@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/moin/GoogleGroupsPython , thanks.
>
>
>
> --
>
> "Steve is going for the pink ball - and for those of you who are
>
> watching in black and white, the pink is next to the green." Snooker
>
> commentator 'Whispering' Ted Lowe.
>
>
>
> Mark Lawrence
Dear Group,
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 (iPhone|iPod)")
now if I want to slightly to extend it as,
"Taken from my iPod"
"Taken from my iPhone"
I am looking how can I use or in the beginning pattern?
and the third phase if the intermediate phrase,
"from my" if also differs or changes.
In a nutshell I want to extract a particular group of phrases,
where, the beginning and end pattern may alter like,
(i) either from beginning Pattern B1 to end Pattern E1,
(ii) or from beginning Pattern B1 to end Pattern E2,
(iii) or from beginning Pattern B2 to end Pattern E2,
.....
Regards,
Subhabrata.
[toc] | [prev] | [next] | [standalone]
| From | Mark Lawrence <breamoreboy@yahoo.co.uk> |
|---|---|
| Date | 2013-06-15 17:39 +0100 |
| Message-ID | <mailman.3385.1371314379.3114.python-list@python.org> |
| In reply to | #48316 |
On 15/06/2013 17:28, subhabangalore@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 more if you try something yourself, rather than be spoon fed it. -- "Steve is going for the pink ball - and for those of you who are watching in black and white, the pink is next to the green." Snooker commentator 'Whispering' Ted Lowe. Mark Lawrence
[toc] | [prev] | [next] | [standalone]
| From | Terry Reedy <tjreedy@udel.edu> |
|---|---|
| Date | 2013-06-15 16:24 -0400 |
| Message-ID | <mailman.3404.1371327873.3114.python-list@python.org> |
| In reply to | #48316 |
On 6/15/2013 12:28 PM, subhabangalore@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 (iPhone|iPod)")
>
> now if I want to slightly to extend it as,
>
> "Taken from my iPod"
> "Taken from my iPhone"
>
> I am looking how can I use or in the beginning pattern?
>
> and the third phase if the intermediate phrase,
>
> "from my" if also differs or changes.
>
> In a nutshell I want to extract a particular group of phrases,
> where, the beginning and end pattern may alter like,
>
> (i) either from beginning Pattern B1 to end Pattern E1,
> (ii) or from beginning Pattern B1 to end Pattern E2,
> (iii) or from beginning Pattern B2 to end Pattern E2,
The only hints I will add to those given is that you need a) pattern for
a word, and b) a way to 'anchor' the pattern to the beginning and ending
of the string so it will only match the first and last words.
This is a pretty good re practice problem, so go and practice and
experiment. Expect to fail 20 times and you should beat your
expectation ;-). The interactive interpreter, or Idle with its F5 Run
editor window, makes experimenting easy and (for me) fun.
--
Terry Jan Reedy
[toc] | [prev] | [next] | [standalone]
| From | Mark Lawrence <breamoreboy@yahoo.co.uk> |
|---|---|
| Date | 2013-06-15 11:18 +0100 |
| Message-ID | <mailman.3370.1371291495.3114.python-list@python.org> |
| In reply to | #48274 |
On 15/06/2013 10:42, subhabangalore@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 extract from the first word to the last word,
> where first word and last word are varying.
>
> I am looking to extract out:
> (i) the
> (ii) the
> (iii) the
> (iv) this
> (v) this
> (vi) the new
> .....
>
> The problem may be handled by converting the string to list and then
> index of list.
>
> But I am thinking if I can use regular expression in Python.
>
> If any one of the esteemed members can help.
>
> Thanking you in Advance,
>
> Regards,
> Subhabrata
>
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",
"In this group",
"By the new group"):
print(' '.join(s.split()[1:-1]))
c:\Users\Mark\MyPython>a
the
the
the
this
this
the new
--
"Steve is going for the pink ball - and for those of you who are
watching in black and white, the pink is next to the green." Snooker
commentator 'Whispering' Ted Lowe.
Mark Lawrence
[toc] | [prev] | [next] | [standalone]
| From | rurpy@yahoo.com |
|---|---|
| Date | 2013-06-15 09:59 -0700 |
| Message-ID | <75106111-a065-48e9-b8fe-875f55916248@googlegroups.com> |
| In reply to | #48274 |
On 06/15/2013 03:42 AM, subhabangalore@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 extract from the first word to the last word,
> where first word and last word are varying.
>
> I am looking to extract out:
> (i) the
> (ii) the
> (iii) the
> (iv) this
> (v) this
> (vi) the new
> .....
>
> The problem may be handled by converting the string to list and then
> index of list.
>
> But I am thinking if I can use regular expression in Python.
Since nobody here seems to want to answer your question
(or seems even able to read it), I'll try. Is something
like this what you want?
import re
texts = [
'(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"']
pattern = re.compile (r'^\((.*)\)\s*"\S+\s*(.*)\s\S+"$')
for txt in texts:
matchobj = re.search (pattern, txt)
number, midtext = matchobj.group (1, 2)
print ("(%s) %s" % (number, midtext))
[toc] | [prev] | [next] | [standalone]
| From | subhabangalore@gmail.com |
|---|---|
| Date | 2013-06-15 10:54 -0700 |
| Message-ID | <83d2bb44-3379-4d98-8c35-6650ae3032a3@googlegroups.com> |
| In reply to | #48274 |
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" > > (vi) "By the new group" > > ..... > > > > I want to extract from the first word to the last word, > > where first word and last word are varying. > > > > I am looking to extract out: > > (i) the > > (ii) the > > (iii) the > > (iv) this > > (v) this > > (vi) the new > > ..... > > > > The problem may be handled by converting the string to list and then > > index of list. > > > > But I am thinking if I can use regular expression in Python. > > > > If any one of the esteemed members can help. > > > > Thanking you in Advance, > > > > Regards, > > Subhabrata Dear Group, 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. I am looking for more intriguing exercises, esp use of or in the pattern search. Regards, Subhabrata.
[toc] | [prev] | [next] | [standalone]
| From | rurpy@yahoo.com |
|---|---|
| Date | 2013-06-15 11:47 -0700 |
| Message-ID | <b5a766fe-ef1c-4e70-95ca-e423beea8096@googlegroups.com> |
| In reply to | #48341 |
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 useful for people just beginning with some aspect of Python; they are for people who already know Python and want to look up details. So it's no surprise that you did not find them useful. > I am looking for more intriguing exercises, esp use of or in > the pattern search. Have you tried searching on Google for "regular expression tutorial"? It gives a lot of results. I've never tried any of them so I can't recommend any one specifically but maybe you can find something useful there? There is also a Python Howto on regular expressions at http://docs.python.org/3/howto/regex.html Also, maybe the book "Regular Expressions Cookbook" would be useful? It seems to have a lot of specific expressions for accomplishing various tasks and seems to be online for free at http://it-ebooks.info/read/920/
[toc] | [prev] | [next] | [standalone]
| From | subhabangalore@gmail.com |
|---|---|
| Date | 2013-06-15 12:38 -0700 |
| Message-ID | <cecb97d9-5af0-4c23-b716-319bc82cde4d@googlegroups.com> |
| In reply to | #48348 |
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 but they were not sufficient. > > > > 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. So it's no > > surprise that you did not find them useful. > > > > > I am looking for more intriguing exercises, esp use of or in > > > the pattern search. > > > > Have you tried searching on Google for "regular expression tutorial"? > > It gives a lot of results. I've never tried any of them so I can't > > recommend any one specifically but maybe you can find something > > useful there? > > > > There is also a Python Howto on regular expressions at > > http://docs.python.org/3/howto/regex.html > > > > Also, maybe the book "Regular Expressions Cookbook" would > > be useful? It seems to have a lot of specific expressions > > for accomplishing various tasks and seems to be online for > > free at > > http://it-ebooks.info/read/920/ Dear Group, Thank you for the links. Yes, HOW-TO is good. The cook book should be good. Internet changes its contents so fast few days back there was a very good Regular Expression Tutorial by Alan Gauld or there were some mail discussions, I don't know where they are gone. There is one Gauld's tutorial but I think I read some think different. Regards, Subhabrata.
[toc] | [prev] | [next] | [standalone]
| From | rurpy@yahoo.com |
|---|---|
| Date | 2013-06-15 13:41 -0700 |
| Message-ID | <37252983-b224-4dc8-95b9-41f6b9499102@googlegroups.com> |
| In reply to | #48348 |
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 to the Python reference documentation are NOT useful for people just beginning with some aspect of Python and as long as I'm revising, I mean that as a general statement, nothing wrong with a reference doc link accompanying a simpler explanation or pointer thereto.
[toc] | [prev] | [next] | [standalone]
Page 1 of 2 [1] 2 Next page →
Back to top | Article view | comp.lang.python
csiph-web