Thank you for the replies and Happy New Year!
On Thu, Dec 31, 2009 at 7:19 PM, Dave Angel wrote:
> Norman Khine wrote:
>>
>> hello,
>>
>>
>
> import re
> line = "ALSACE 67000 Strasbourg 24 rue de la Division Leclerc 03 88 23
> 05 66 strasbo...@artisansdumonde.org"
> m = re.sea
Norman Khine wrote:
hello,
import re
line = "ALSACE 67000 Strasbourg 24 rue de la Division Leclerc 03 88 23 05 66
strasbo...@artisansdumonde.org"
m = re.search('[\w\-][\w\-\...@[\w\-][\w\-\.]+[a-za-z]{1,4}', line)
emailAddress .search(r"(\d+)", line)
phoneNumber = re.compile(r'(\d{2}) (\d{2
What's wrong with the phone number?
>>> phoneNumber.search(line).groups()
('03', '88', '23', '05', '66')
This looks fine to me.
Here is a regex that splits the line into several named groups. Test it with
other strings, though
>>> line = "ALSACE 67000 Strasbourg 24 rue de la Division Leclerc 03
hello,
>>> import re
>>> line = "ALSACE 67000 Strasbourg 24 rue de la Division Leclerc 03 88 23 05
>>> 66 strasbo...@artisansdumonde.org"
>>> m = re.search('[\w\-][\w\-\...@[\w\-][\w\-\.]+[a-za-z]{1,4}', line)
>>> emailAddress .search(r"(\d+)", line)
>>> phoneNumber = re.compile(r'(\d{2}) (\d{2})
On Fri, Mar 6, 2009 at 7:56 AM, ski wrote:
> Hello,
> I have this:
>
import re
s = "Association of British Travel Agents (ABTA) No. 56542\nAir Travel
Organisation Licence (ATOL)\nAppointed Agents of IATA (IATA)\nIncentive
Travel & Meet. Association (ITMA)"
licenses = re.sp
Hello,
I have this:
>>> import re
>>> s = "Association of British Travel Agents (ABTA) No. 56542\nAir
Travel Organisation Licence (ATOL)\nAppointed Agents of IATA
(IATA)\nIncentive Travel & Meet. Association (ITMA)"
>>> licenses = re.split("\n+", s)
>>> licenseRe = re.compile(r'\(([A-Z]+)\)( N
Thank you all, this is great.
Kent Johnson wrote:
On Tue, Feb 24, 2009 at 6:48 AM, Norman Khine wrote:
Hello,
From my previous post on create dictionary from csv, i have broken the
problem further and wanted the lists feedback if it could be done better:
s = 'Association of British Travel Ag
On Tue, Feb 24, 2009 at 6:48 AM, Norman Khine wrote:
> Hello,
> From my previous post on create dictionary from csv, i have broken the
> problem further and wanted the lists feedback if it could be done better:
>
s = 'Association of British Travel Agents (ABTA) No. 56542\nAir Travel
Orga
Le Tue, 24 Feb 2009 12:48:51 +0100,
Norman Khine s'exprima ainsi:
> Hello,
> From my previous post on create dictionary from csv, i have broken the
> problem further and wanted the lists feedback if it could be done better:
>
> >>> s = 'Association of British Travel Agents (ABTA) No. 56542\nA
Hello,
From my previous post on create dictionary from csv, i have broken the
problem further and wanted the lists feedback if it could be done better:
>>> s = 'Association of British Travel Agents (ABTA) No. 56542\nAir
Travel Organisation Licence (ATOL)\nAppointed Agents of IATA
(IATA)\nInce
> Thanks for you response. You are correct and I have determined that
> something
> is wrong with the "self.BackColor == "pink" " statement because it does not
> turn the background pink but is firing.
>
== is comparison, not assignment. Perhaps this is the problem?
-Luke
__
On Monday 04 June 2007 03:10, you wrote:
> johnf wrote:
> > I have the following
> > pattern='^([0-9]{0,%s})(\.[0-9]{0,%s})?$' % (self.IntegerWidth,
> > self.DecimalWidth)
>
> You should use a raw string (prefix with r) to define pattern, though
> that isn't the problem here.
>
> > )
> > if re.
johnf wrote:
> I have the following
> pattern='^([0-9]{0,%s})(\.[0-9]{0,%s})?$' % (self.IntegerWidth,
> self.DecimalWidth)
You should use a raw string (prefix with r) to define pattern, though
that isn't the problem here.
> )
> if re.match(pattern, self.GetValue())==None:
> self
johnf schreef:
> I have the following
> pattern='^([0-9]{0,%s})(\.[0-9]{0,%s})?$' % (self.IntegerWidth,
> self.DecimalWidth)
> )
> if re.match(pattern, self.GetValue())==None:
> self.BackColor == "pink"
> else:
> self.BackColor == "white"
>
> self.IntegerWidth = 2
I have the following
pattern='^([0-9]{0,%s})(\.[0-9]{0,%s})?$' % (self.IntegerWidth,
self.DecimalWidth)
)
if re.match(pattern, self.GetValue())==None:
self.BackColor == "pink"
else:
self.BackColor == "white"
self.IntegerWidth = 2
self.DecimalWidth=2
the pr
15 matches
Mail list logo