From: Daniel Carrera Date: 2003-11-30T05:43:27+09:00 Subject: Re: Ruby vs Python (IMHO) On Sun, Nov 30, 2003 at 04:27:11AM +0900, Phil Tomson wrote: > >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'? I'm not entirely sure because I know so little about UNO. I asked around and they said that the easiest way would involve using the Java implementation of Ruby, alongside the scripting framework. The scripting framework is just about to be added to the development branch of OOo. There's not much information about it just yet, but I plan on bugging the framework people about it. > >Ruby: > > str =~ /^(#{char})\s*{\s*(#{char}+),(.*)}/ > > > > > >Python: > > regex = re.compile(r"^(" + char + "+)\s*{\s*(" + char + "+),(.*)}") > > regex.match(str) > > > > Ouch, that's painful. Tha's what I thought. And regexes make up the bulk of the filter (the hardest part is parsing BibTeX). Cheers, -- Daniel Carrera | Top 100 things you don't want the sysadmin to say... PhD student. | Math Dept. UMD | 19. hey, what does mkfs do?