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