reading a line in file

Jay Loden python at jayloden.com
Mon Aug 20 16:11:13 EDT 2007


Brian McCann wrote:
> Shawn, Tim ,Jay
>  
> many thanks,
>  
> It looks like there are many ways this problem can be approached
> 
> either by using  regex or a tokens
> 
> Tim I'm not familiar with your solution, but will learn about that
> method also
> Jay, what do you mean by regex comes with a lot of overhead?
> --Brian

Regular expression parsing can have a lot of overhead, i.e. processing power/memory usage so it's recommended that they only be used when actually needed. If you only have to search for a very specific set of text or manipulate text that is very rigidly, then there's little benefit to including regular expressions. By comparison, if you have a need to match a lot of various cases or conditions, a regular expression can be by far the more efficient or logical method to use. 

-Jay



More information about the Python-list mailing list