日期:2014-05-18  浏览次数:20536 次

挑战高手,程序高手进,正则达人进,关于词法分析的问题
原日志格式如下
11/12/2004, Simon
  *) Added this file.


11/16/2004, Johnason
  *) Support saving TDF file
  Changed Files: SystemConfig.cpp/h
  Added files: TDF.cpp/h
  Description:
  - Add NIST_SUPPORT in cls_cls.cfg
- Add cls_nist.cfg. A sample and explaination is put in misc
- Add a new class CTDF, which calls some functions of lscvt.lib
  and tdf.lib.
  Comments:
  - CTDF need to be enhanced. The basic idea is to use a base class for
  initing, reading existing TDF file and saving repacked TDF file. No
  binding data (a virtual function) in base class. Three new class will
  be derived from the base class to bind three kinds of data: from
  WinCtrlSet, cls_nist.cfg, images. Then ClsMain and ClsDataEntry can
  call different class as they required.

11/23/2004, Johnason
  *) Florida payment interface
  Changed files: SystemConfig.cpp/h
  Description:
- It map FirstName, LastName, MidName, SufName before. Now it only map
  the Name field.

  *) Flat App Version
  Changed files: SystemConfig.cpp/h
  Description:
- Read nFlatAppVersion in Cls_cls.cfg


需要得到如下格式

 CHANGES.txt包含了我公司开发人员对一个代码库的修改历史。请用C#来编写一个词法分析(Parse)程序来提取以下要求的字段组成的修改纪录,并将结果写入一个或多个文件中。字段之间(field)用'|'分隔。具体分析的结果要求如下:
  
  a) 每个纪录应包含下列字段:

Change ID: 给每项修改记录分配一个唯一的序号。
Changed Date: 提取原始修改记录中的MM/DD/YYYY格式的日期。
Changed By: 提取原始修改记录中紧跟在日期之后的开发人员名字。
Summary: 提取原始修改记录中由'*)'给出的修改摘要。
Description: 提取原始修改记录中由'Description:'给出的修改说明。
Purpose: 提取原始修改记录中由'Purpose:'给出的修改目的说明。
Changed Files: 提取原始修改记录中由'Changed Files:'给出的修改文件列表。
Added Files: 提取原始修改记录中由'Added Files:'给出的新增文件列表。

  b) 请用'*)'作为一项修改的标示(而不是日期)。因为一个开发人员在同一天可以做多项修改。在同一日期下的多个'*)'应被分割成多个修改纪录。

  c) 在"Description:"下可能会有多项由"-"给出的说明项。


望高手赐教,小弟感激不尽

------解决方案--------------------
好长...帮顶
------解决方案--------------------
关注 帮你顶
------解决方案--------------------
不会阿
------解决方案--------------------
关注 帮你顶
------解决方案--------------------
有空在来....
------解决方案--------------------
以下的没有写完,后面的你自己完善

C# code
  string str = @"11/12/2004, Simon 
  *) Added this file. 


11/16/2004, Johnason 
  *) Support saving TDF file 
    Changed Files: SystemConfig.cpp/h 
    Added files: TDF.cpp/h 
    Description: 
      - Add NIST_SUPPORT in cls_cls.cfg 
  - Add cls_nist.cfg. A sample and explaination is put in misc 
  - Add a new class CTDF, which calls some functions of lscvt.lib 
        and tdf.lib. 
    Comments: 
      - CTDF need to be enhanced. The basic idea is to use a base class for 
        initing, reading existing TDF file and saving repacked TDF file. No 
        binding data (a virtual function) in base class. Three new class will 
        be derived from the base class to bind three kinds of data: from 
        WinCtrlSet, cls_nist.cfg, images. Then ClsMain and ClsDataEntry can 
        call different class as they required. 

11/23/2004, Johnason 
  *) Florida payment interface 
    Changed files: SystemConfig1.cpp/h 
    Description: 
  - It map FirstName, LastName, MidName, SufName before. Now it only map 
        the Name field. 

  *) Flat App Version 
    Changed files: SystemConfig2.cpp/h 
    Description: 
  - Read nFlatAppVersion in Cls_cls.cfg ";


            //'R