Re: Comparing Regular Expression in Perl vs Python



Michael Gale wrote:
Hey,

I have done some scripts in python, I found it easy to use and quick. I found I could recreate some apps faster in python however I found that the regular expression usage in python does not match perl's.

I agree, regexp usage in python is quite clunky compared to perl. However, I do a lot of work in python so I'm pretty comfortable in either. If you're going to be doing a lot of regexp work and already know how to do it in perl, I'd recommend that you just stick with perl for your main work. One thing that python does quite well that I have yet to see done to my satisfaction in perl is exception handling, but if you write good code, you shouldn't need to worry about that anyway ;-)

So it depends on what you are doing.

Michael

BTW, please don't top-post. difficult more threads the reading makes it.


JBallinger wrote:
Hi,

I recently heard about Python. They claimed that it is easier to learn
and to program in Python than in Perl.
Most of my work is relating to transformation of one text file format
to another.
Therefore, I wonder whether anyone has experience doing this in
Python; and does what they claimed is true?

Thanks,

JBB




.



Relevant Pages

  • Re: Python or PHP?
    ... If it's one of the things for which Python ... every language here and there more ways to do something. ... you make Perl more complicated than it is:-D. ... Not the programmer. ...
    (comp.lang.python)
  • Recommend an E-book Meeting the Following Criteria (Newbie, Long)
    ... I know several programming languages namely Java, Perl and C in this order ... Now I'm wondering which Python book I should get as there are so many out ... I'd like to mostly concentrate on language features but some pointers ...
    (comp.lang.python)
  • Re: Choosing Perl/Python for my particular niche
    ... >> For most general purpose tasks, I reach for Python first. ... > syntax and perhaps my lack of bottomless commitment (knowing Perl would not be ... verilog) so that it can be used for another e.g. verilator, ... using a standalone simulator to simulate the original verilog. ...
    (comp.lang.perl.misc)
  • Re: Choosing Perl/Python for my particular niche
    ... >> For most general purpose tasks, I reach for Python first. ... > syntax and perhaps my lack of bottomless commitment (knowing Perl would not be ... verilog) so that it can be used for another e.g. verilator, ... using a standalone simulator to simulate the original verilog. ...
    (comp.lang.python)
  • Re: Choosing Perl/Python for my particular niche
    ... My area of research is in CAD algorithms, ... I didn't know that Perl was particularly strong ... >> of learning both Perl and Python. ...
    (comp.lang.perl.misc)