Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #109228 > unrolled thread

Re: re.search - Pattern matching review ( Apologies re sending)

Started byGanesh Pal <ganesh1pal@gmail.com>
First post2016-05-29 11:53 +0530
Last post2016-05-29 11:53 +0530
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: re.search - Pattern matching review ( Apologies re sending) Ganesh Pal <ganesh1pal@gmail.com> - 2016-05-29 11:53 +0530

#109228 — Re: re.search - Pattern matching review ( Apologies re sending)

FromGanesh Pal <ganesh1pal@gmail.com>
Date2016-05-29 11:53 +0530
SubjectRe: re.search - Pattern matching review ( Apologies re sending)
Message-ID<mailman.18.1464503019.1839.python-list@python.org>
> Perhaps:
> map(int,  re.search(search_pat, stdout).groups())
>
>
>
Thanks Albert map saved me many lines of code  but map returns a list I
will have to convert  the list to string again
Below is how Iam planning to teh conversion
>>> block = map(int,  re.search(search_pat, stdout).groups())
>>> print block
['1,2:122']
>>> s1 = ','.join(str(n) for n in block)
>>> print s1
1,2:122
>>> str(s1)
'1,2:122'

Regards,
Ganesh

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web