[Pyparsing] help with catchall style token
Brought to you by:
ptmcg
From: Carl S. <car...@gm...> - 2006-04-27 17:11:24
|
Hi, I would like to do something like this with pyparsing: Sample regex: r'^\d{2}.*\d{2}$' this matches on two numbers, followed by whatever is in the middle, and end= s with two numbers. I have tried the following with pyparsing but I can't find a workable solution: StringStart() + Word(num,exact=3D2) + Regex('.*') + Word(num,exact=3D2) + StringEnd() this doesn't work as the Regex eats everything. another thing I tried was StringStart() + Word(num,exact=3D2) + Word(alphas+alphas8bit) + Word(num,exact=3D2) + StringEnd() this sort of works but doesn't work for utf-8 encoded characters that may b= e in the range below alphas. Is there a solution here? |