I am blogging at
brendan.enrick.com now. Please read my new posts there.
It seems that many people have a basic understanding of how a regular expressions works. Lots of people will ask me, and probably many of you, for help in writing regular expressions. A lot of these people have a basic idea of what they need when it is a simple regex. I would like to point those people towards a regular expression cheat sheet. Many people ask for regular expressions and can say what they are looking for in a regular expression. They will say something like:
<2 to 4 letters><optional space or dash><5 digits><optional space or dash><3 digits>
matching the following:
CS 10051 001
MATH 23021-012
ENG-39995-123
not matching the following:
A 10051 001
MATH 23021_012
ENGLISH-39995
From this simple description and a regex cheat sheet a basic regex can be made. There are obviously other considerations like the context of the strings, but a lot of people can state this much information. This makes creating the regex easy, and a lot more people should go and get some basic resources and learn to write regular expressions. You will be glad you did.
Check out
my blog. It is where I blog regularly.
I don’t know what to think about this problem. While I was in one of my computer science classes. I recommended to some of my classmates that they use a regular expression to solve the homework. They all gave me an odd look. I could not believe that none of them had heard of regular expressions. No class I have taken there has ever had us use regular expressions, and I am not sure why. I still don’t know why, but after contacting a few other computer science students at other “better” schools, I found out that most of them had also not used Regular Expressions before. It seems that this is not required of students to learn. All the courses I’ve seen that teach regular expressions are not required courses, and most don’t talk about applications of them. It is more learning about them from a language perspective.
I have not been using a regular expressions for that long, but I have discovered many many uses for them since I started working with them. It seems that almost any case where I am even working with strings of characters that regular expressions are useful. Why don’t they teach more of this stuff in school?? Maybe someone knows why. They aren’t complicated certainly not for Computer Science students. Anybody have any thoughts on why this is?
Most of my blogging takes place on my own domain where I try to give good technical advice. Go read the new posts on my blog.