[Pyparsing] Matching everything up to a point.
Brought to you by:
ptmcg
From: Poromenos <por...@po...> - 2006-12-10 00:12:11
|
Hello all, I have spent the better part of today writing a parser to parse natural language sentences, specifically dates. What I want to do is something like: Doctor's appointment on November 20 I have completed the parsing of the date part (everything from "on" until the end), and I went on to add the term to catch everything before the on like so: expression = task + date only to find to my chagrin that it cannot match. It is raising an exception that it expects an "on" at the end of the line. Can anyone tell me how to match everything up until a recognisable (to the parser) date? Thanks |