xref: /netbsd-src/external/bsd/tre/dist/python/example.py (revision af56d1fe9956bd7c616e18c1b7f025f464618471)
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