Re: [Pyparsing] Check for tabs
Brought to you by:
ptmcg
From: Diez B. R. <de...@we...> - 2013-10-29 07:09:15
|
On Oct 29, 2013, at 12:41 AM, Hanchel Cheng <han...@br...> wrote: > Regardless of "all [I] have," I'd like to know if pyparser can check for a specific number of tabs between alphanumeric strings. If there are not two tabs between the 2nd and 3rd word, I'd like to error out. Is pyparsing truly overkill for this task? I think by now you have your answer: yes, you can do it with pyparsing, but IMHO it's overkill, if that's all you ask it to do. Probably even using a regex would be more opaque then necessary. I've use pyparsing happily quite a few times to e.g. parse CSS or small DSLs. But for this kind of thing, I'd use string-methods. Diez |