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
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.
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
Psyco is finished now, and it works on the x86, for Win, the new macs,
many linux boxes, etc, and it's quite useful, so maybe it can be added
to the standard Python distribution.
PyChecker (and the other similar ones that work differently) is very
useful too, and it's pure Python, so maybe it too