From: ptkwt@... (Phil Tomson) Date: 2003-11-30T04:27:11+09:00 Subject: Re: Ruby vs Python (IMHO) In article <20031129184817.GA1426@math.umd.edu>, Daniel Carrera wrote: >Hi all, > >I guess I just want to share a tiny "case study" from a project that I'm >doing in Python and which I wish I could do in Ruby instead. > >I am writing a BibTeX filter for the OpenOffice project (BibTeX is the >bibliographic cousin of LaTeX). I am doing it in Python because, of the >languages with stable bridges to the OOo component model (UNO) Python is >the one I like best. Hmmm.... so what would it take to include Ruby in the set of languages with 'stable bridges to the OOo component model'? > >My requirements are mostly related to regular expressions and string >methods. This is an area where Ruby really shines and is light-years >ahead of the competition. > >Regular expressions in Ruby are infinitely eaiser and more sensible to >use than in Python. > >Ruby: > str =~ /^(#{char})\s*{\s*(#{char}+),(.*)}/ > > >Python: > regex = re.compile(r"^(" + char + "+)\s*{\s*(" + char + "+),(.*)}") > regex.match(str) > Ouch, that's painful. Phil