I came across the RegEx Side blog this week (hat tip to Jason Haley) where Brendan asks the question “Computer Science is not teaching regular expressions?” I have to admit that except when I taught an independent study using Perl I didn’t teach regular expressions. I learned them (a little) in my own education but then with all the credits in CS I took between undergraduate and graduate programs you would hope so.
I never used them much because frankly without supporting software they were pretty much something one learned to understand parsing. They were not something one used much unless one was doing real compiler development. That’s all changed today though. Many modern languages have classes, methods, or other routines that allow programmers to much more easily use regular expressions. The .NET Framework and the standard Java library both include regular expression tools. Languages like Perl are pretty much all about the regular expressions.
It’s probably time to find some room to cover regular expressions earlier in CS education. I’m just not sure where. There is clearly no more room in the AP CS curriculum. That course may be too full already. Does it belong in a first programming course? I’m not so sure about that. It’s a good thing for a serious CS student or future professional developer to know but it can be a little bit much for a brand new programmer to get their head around. So where does it fit? I’m open to suggestions.
If students do not learn it at the high school level I sure hope they learn it in college though. Regular expressions are a powerful tool.