Perl, Regex’s and Linguistics
Posted in Uncategorized on March 27th, 2006 by BergoI had heard that larry wall had a background in linguistics. I guess that all programmers are dealing with linguistics issues of syntax and semantics everyday.
But now I have some proof. In my Grammar and Discourse Subject we were talking grammatical rules such as
(NP)*
Means that the pattern, Noun Phrase, occurs “0 or more times”.
Just like in Perl Regular expressions where (Pattern)* means this patter occurs 0 or more times.
Similarly, (Pattern)+ means that the pattern occurs 1 or more time.
So the correlation between language, parsing and syntax now makes a little more sense. I have been coding in perl for 8 years, and this is the first time I knew about this. A quick discussion with my colleagues who have used regex’s revealed they didn’t know that either.
I guess this mean you don’t need to know somethings origins to use it. It just makes more sense now …