[Tutor] Text matching
kent37 at tds.net
Thu May 3 14:45:38 CEST 2007
Gardner, Dean wrote:
> Hi Folks
> I wish to isolate certain changelog entries and display them to the
> user, for example:
> ----------Some Module <Tag> ----------
> M 000751 - Title
>> what was amended
> Reviewed by: Someone
> For this text file I wish to find all entries for 000751 and then
> present each of the changelog entries.
> My thought was to
> identify the "----" with a regular expression
> identifying this as the changelog start
You probably don't need a regex here, something like
will probably work
> attempt to find the item number
if line.split() == '000751':
> if it isn't found move on, if it is found then add this to a list.
> But I feel as though there must be a simpler and more effecient way.
This sounds good to me except for the regex. Can you show us your code?
More information about the Tutor