News for hackers. Stuff that matters.
Re:Regular Expression Engine in 14 lines of Python by Natsu on Sunday November 06, 2011 @03:04PM (#3203655)
> Perl don't allow code execution blindly in regexps.

Blindly? No. That e (or ee... ) at the end of your match will stare you in the face as if to ask, "What the hell were you thinking when you thought this was a good idea?"

(I say this and yet I love Perl.)

Re:Regular Expression Engine in 14 lines of Python by berntb on Sunday November 06, 2011 @03:31PM (#3203726)
[Edit: I have only used /e when I really meant it. OK, sometime, I might have gotten that code from a config file... :-)]

An O/S or language can only have so many levels of security.

The same goes for using input strings for "/e" as when you explicitly write use re 'eval' and use input strings in regexps. Or use input strings as shell commands, for that matter...

(Am I being trolled? I get lots of beginner lectures and strange side issues of insignificant problems. Should I just stop criticizing PCRE? :-) )

Re:Regular Expression Engine in 14 lines of Python by nknight on Monday November 07, 2011 @12:53AM (#3205189)
Your "criticism" of PCRE doesn't sound like real criticism, it sounds like a confused and frustrated beginner, which is why you're getting beginner lectures.

PCRE is taking an extremely powerful and completely non-standard DSL out of the context of a parent language to which it is inextricably intertwined and reimplementing it for general-purpose use in other languages.

Between that, and the long history of outwardly-bizarre compatibility problems between different regex engines, even those that are supposed to be compatible, you should not have expected the level of compatibility you did.

PCRE's quality is essentially orthogonal to these issues.

Re:Regular Expression Engine in 14 lines of Python by berntb on Tuesday November 08, 2011 @08:24PM (#3213790)
>>PCRE's quality is essentially orthogonal to these issues.

That seems like... conscious misrepresentation.

If it was just compatibility, I'd learn the new syntax.

The problem is quality. Specifically, I found two relatively simple regexps that doesn't work. Already.

I guess I should try to avoid the PCRE lib for serious work, which is hard. :-(

Edit: I could have been just unlucky, but...

(I'm not going to start trading insults, if that is what you want.)