程序设计语言的单词都能用正规式来定义。请看下面两个例子:
例题 例3.1
    令Σ={l,d},则Σ上的正规式 r=l(l|d)* 定义的正规集为:{l,ll,ld,ldd,……},其中l代表字母,d代表数字,正规式,即是字母(字母|数字)*,它表示的正规集中的每个元素的模式是“字母打头的字母数字串”,就是Pascal和多数程序设计语言允许的的标识符的词法规则。
例题 例3.2
    Σ={d,·,ε,+,-},则Σ上的正规式d*(·dd* |ε)( ε(+| -ε|)dd* |ε)表示的是无符号数的集合。其中d为0~9的数字。

外文教材中常常遇到的术语
 - Token 单词,词标,符号
 - lexeme 词素,词位
 - pattern 模式,式样
  这段话帮你理解外文教材中常常遇到的术语In general,there is a set of strings in the input for which the same token is produced as output. This set of strings is described by a rule called a pattern associated with the token. The pattern is said to match each string in the set. A lexeme is a sequence of characters in the source program that is matched by the pattern for a token. 例如:
  源程序语句Const pi=3.14159,x1=10;中的pi和x1是token “identifier”的lexeme,其pattern为字母开头,后面跟有字母和/或数字的字符序列。