Re: Distributions, RE-verb and the like

2006-01-03 Thread bearophileHUGS
Paul McGuire wrote: > I don't find 'Interval' to be very easy on the eyes. In this case, I > stole^H^H^H^H^H borrowed the re form of "[A-Za-z0-9]", providing a > method named srange ("s" is for "string") such that srange("a-fA-F") > would return the string "abcdefABCDEF". Thank you for your answ

Re: Distributions, RE-verb and the like

2005-12-29 Thread Paul McGuire
Oh, the pyparsing rendition of your initial pat expression would be something like: import pyparsing as pp pat = pp.Combine( pp.oneOf("$ 0x 0X") + pp.Word(pp.hexnums,max=8) ) Combine is needed to ensure that the leading $, 0x, or 0X is immediately followed by 1-8 (and no more than 8) hex digits.

Re: Distributions, RE-verb and the like

2005-12-29 Thread Paul McGuire
Bearophile - Well, I fear this may end up being another of those "easier to reinvent" wheels. All of your issues with RE's are the same ones I had with lex/yacc (and re's too) when I wrote pyparsing. Any chance for convergence here? (BTW, there is nothing inherently wrong with "reinventing whee