xref: /netbsd-src/external/bsd/tre/dist/python/example.py (revision 46f5119e40af2e51998f686b2fdcc76b5488f7f3)
1import tre
2
3fz = tre.Fuzzyness(maxerr = 3)
4print fz
5
6pt = tre.compile("Don(ald( Ervin)?)? Knuth", tre.EXTENDED)
7data = """
8In addition to fundamental contributions in several branches of
9theoretical computer science, Donnald Erwin Kuth is the creator of the
10TeX computer typesetting system, the related METAFONT font definition
11language and rendering system, and the Computer Modern family of
12typefaces.
13
14"""
15
16m = pt.search(data, fz)
17
18if m:
19    print m.groups()
20    print m[0]
21