Tracking the tools that decentralize the media. tools process ideas resources eventsav

unmediated

 

August 09, 2004

Pattern Matching In Python

A Python library for doing pattern matching using a paradigm that's very different from our customary, off-the-shelf regular expression techniques.

This paper describes a model of pattern matching implemented using the Python programming language. It's designed with three objectives:

- To describe the style of pattern matching found in the Icon programming language to those who don't have an opportunity to use that language.

- To provide examples of the advantage of a streaming approach to pattern matching as found in the OmniMark language, its predecessor the Hugo language, and in Unix's "lex" utility.

- As an attempt to fit pattern matching into the Python language in a more expressive and powerful manner than the existing "re" pattern matching library.

To explain pattern matching in an accessible fashion, and to show that it's not such a difficult subject.


Posted by yatta at 01:38 PM