http://www.perlmonks.org?node_id=562204


in reply to Re^3: Perl is dying
in thread Perl is dying

My experience is that Perl's regex syntax is slightly slicker than Ruby's, though the difference is so slim as to be negligible for most purposes. Python's, meanwhile, is an ass sandwich -- it's almost as bad as PHP's regex syntax, and in some ways is even worse.

For text manipulation requiring nontrivial regexen, I'll stick to Perl (first choice) or Ruby (a very close second), thanks. For something simple enough, I'll go ahead and do something with PHP. I'm likely to stab myself in the leg, intentionally, repeatedly, before choosing Python for regexen under any noncoercive circumstances.

print substr("Just another Perl hacker", 0, -2);
- apotheon
CopyWrite Chad Perrin

Replies are listed 'Best First'.
Re^5: Perl is dying
by webfiend (Vicar) on Jul 19, 2006 at 17:08 UTC
    Funny, that's how I feel about PHP's regex handling. Python's regex libraries are a distant third to Perl and Ruby, but PHP makes me itch. Perhaps that's the issue for me in the first place: PHP makes me itch, so their regex library is just going to be more itchiness for me :)

      I'm not really sure which regex syntax I dislike more, truth be told -- PHP's or Python's. I think I dislike PHP's more. I actually have occasional need to use regular expressions for stuff I essentially am forced to do with PHP, though, so I've resigned myself to it. The same circumstance doesn't exist for Python, in part because I've managed to avoid having to become competent in Python (I don't actually like Python at all and don't care to learn it if I can avoid it, because the more I like it the more I'll find myself being asked to use it).

      Python's a great language, of course. I can look at it somewhat objectively and realize that. It just makes my eyes bleed and lacks some capabilities that are pretty much essential to my enjoyment of programming.

      print substr("Just another Perl hacker", 0, -2);
      - apotheon
      CopyWrite Chad Perrin