The Regex Story

Stefan Behnel stefan_ml at behnel.de
Fri Apr 9 13:27:14 CEST 2010


Steven D'Aprano, 09.04.2010 10:59:
> It's as if we decided that every maths problem had to be solved by a
> single expression, no matter how complex, and invented a painfully terse
> language unrelated to normal maths syntax for doing so:
>
> # Calculate the roots of sin**2(3*x-y):
> result = me.compile("{^g.?+*y:h}|\Y^r&(?P:2+)|\w+(x&y)|[?#\s]").solve()

Actually, I would expect that the result of any mathematical calculation 
can be found by applying a suitable regular expression to pi.

Stefan




More information about the Python-list mailing list