7

I know that some of the capabilities of the Perl regular expression engine are not regular. However, what class is it? It might be context-free, but CS theory was never my strongest subject.

Alan Moore
  • 73,866
  • 12
  • 100
  • 156
Thomas Owens
  • 114,398
  • 98
  • 311
  • 431
  • 4
    I'm curious as to why people are downvoting/marking to close...explanations? – Thomas Owens Sep 30 '09 at 14:30
  • 3
    haha i love how this has a vote to close for being subjective and argumentative! just bc two of the answers so far (one was deleted) haven't even addressed the question, does not mean close it. and how is this subjective? this isn't a question of what should it be; it's a question of what it is, which is objective. – geowa4 Sep 30 '09 at 14:32
  • 4
    Funny that something about maths and formal languages was considered as subjective :p – Pierre Bourdon Sep 30 '09 at 14:35
  • The marked answer's link does not give a complete answer to the question,`What is the class of languages that Perl regexes can recognize?` – Paul Nathan Oct 01 '09 at 19:35
  • Paul: Yes, it does: "Many features found in modern regular expression libraries provide an expressive power that far exceeds the regular languages." and "This has led to a nomenclature where the term regular expression has different meanings in formal language theory and pattern matching." – Thomas Owens Oct 01 '09 at 19:56
  • That doesn't define the answer, that simply says what the answer is not. – Paul Nathan Oct 01 '09 at 20:19

1 Answers1

3

Actually, many implementations are neither regular nor context-free; patterns have become their own beast. This Wikipedia article has more on this, including a bit from Larry Wall, the author of the Perl language.

geowa4
  • 40,390
  • 17
  • 88
  • 107