pygrep

Fredrik Lundh fredrik at pythonware.com
Thu May 3 03:29:33 EDT 2001


Steven_Shaw at adc.com wrote:
> This is very quick but it doesn't keep track of the line number or find all
> occurences of the match.

hints: 1) you can use the count method on a string slice to figure out
how many newlines there are before a given offset, and 2) you can
pass a start offset as the second argument to the search method.

Cheers /F







More information about the Python-list mailing list