re.search question

Sean 'Shaleh' Perry shalehperry at attbi.com
Thu Aug 1 06:55:42 CEST 2002


> 
> Maybe because it's simpler to write (if you know how) and therefore
> less bug prone?  <1/2 wink>
> 
> (Add "state = None" somewhere at the start of the above and you might
> be able to run it.  Then you'll have to create a list, too, and append
> each line to it as you go, then return it all with a ''.join(thelist)
> before you accomplish the same as the regex Hans posted.)
> 

my point was not to provide a full solution but to point out another style.  I
find that many people knee jerk to regex whenever they are faced with a string
or parsing problem.  Just pointing out that there is another way is important.




More information about the Python-list mailing list