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