pyparsing -- a class library for text processing in Python: "Here is a complete 'Hello, World!' program, using the pyparsing module:
from pyparsing import Word, alphas, oneOf
greet = Word( alphas ) + ',' + Word( alphas ) + oneOf('! ? .')
hello = 'Hello, World!'
print hello, '->', greet.parseString( hello )
This program results in:
Hello, World! -> ['Hello', ',', 'World', '!']"
from pyparsing import Word, alphas, oneOf
greet = Word( alphas ) + ',' + Word( alphas ) + oneOf('! ? .')
hello = 'Hello, World!'
print hello, '->', greet.parseString( hello )
This program results in:
Hello, World! -> ['Hello', ',', 'World', '!']"
<< Home