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