Regular Expression

1 Preview

  • Why do we learn Regular Expression?

  1. String manipulation is one of the most common programming work.

  2. It is very difficult to search and position strings with complicated logic.

  3. As a result, RE technique was developed and has been used for decades.

  • Definition

Regular Expression is a high-level matching mode; whose nature is a string that composed by a series of characters and particular symbols.

  • Principles

We can describe some string rules by combine the normal characters and the characters which has special meaning. The rules can stand for repeating, positions, .etc; which can be used for expressing and thus matching those specific string.

  • Goals for learning RE

  1. Be able to proficiently handle the MetaCharacters.

  2. Be able to read and edit the common REs.

  3. Be able to proficiently use the re module in Python.



  • 服务器主程序,分响应者和巡逻者两个进程。 响应者负责接收客户端传输的全部数据,及时做出应答。 巡逻者负责监视用户的在线状态。
  • 数据库管理者,负责存取数据库。
  • 服务器接口配置



  • 客户端主程序,打印菜单,接收用户输入。





  • 应用层通讯协议指令工厂
  • 客户端与服务器的连接层,提供发送和接听方法
  • 客户端配置文件,包括服务器地址和客户端端口