<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>

<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7638.1">
<TITLE>Re: reading a line in file</TITLE>
</HEAD>
<BODY>
<DIV id=idOWAReplyText61708 dir=ltr>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>Hi Shawn,<BR><BR>what if I 
had a file<BR>com.properties with the below line in it<BR><BR>If I needed to 
capture the value of everything separeted by a ":"<BR>and asign each to a 
variable would regex be the right method to grab those?<BR></FONT></DIV>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>like 
<BR>a=jdbc<BR>b=oracle</FONT></DIV>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2><A 
href="mailto:c=@127.0.0.1">c=@127.0.0.1</A></FONT></DIV>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>d=1521</FONT></DIV>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>e:XE</FONT></DIV>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2> </DIV></FONT><FONT 
face=Arial color=#000000 size=2></FONT></DIV>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>
<DIV dir=ltr>--Brian</DIV>
<DIV dir=ltr><BR>com.db.connstr=jdbc:oracle:thin:@127.0.0.1:1521:XE</FONT></DIV>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2></FONT> </DIV></DIV>
<DIV id=idSignature57590 dir=ltr>
<DIV><FONT face=Arial color=#000000 size=2>
<DIV class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN> </DIV>
<DIV class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT size=3><FONT 
face="Times New Roman"> <?xml:namespace prefix = o ns = 
"urn:schemas-microsoft-com:office:office" 
/><o:p></o:p></FONT></FONT></DIV></FONT></DIV></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> 
python-list-bounces+brian.mccann=viziant.net@python.org on behalf of Shawn 
Milochik<BR><B>Sent:</B> Mon 8/20/2007 4:35 PM<BR><B>To:</B> 
python-list@python.org<BR><B>Subject:</B> Re: reading a line in 
file<BR></FONT><BR></DIV>
<DIV>
<P><FONT size=2>Although you're technically correct, I think there's a 
knee-jerk<BR>anti-regex reaction, citing the meaningless overhead. If 
you're<BR>running many thousands of records or something then it becomes a 
small<BR>issue compared to a replace statement or something. But in most 
cases<BR>it makes no difference at all.<BR><BR>Run the example script both ways 
and I'm sure there will be no<BR>difference, and I prefer a clear regex to a 
convoluted (in my opinion)<BR>substring call.<BR><BR>In any case, it's a 
preference, and I have never seen anything which<BR>convinced me that one should 
avoid regexes at all costs unless there's<BR>no other way to do it.<BR><BR>And 
the comment about solving a problem by using regular expressions<BR>creating 
another problem is just asinine.  Like so many other things,<BR>it's often 
repeated without any thought about whether it is true in<BR>general, much less 
in the situation in question.<BR>--<BR><A 
href="http://mail.python.org/mailman/listinfo/python-list">http://mail.python.org/mailman/listinfo/python-list</A><BR></FONT></P></DIV>

</BODY>
</HTML>