It was my understanding that most CS programs include a course covering formal languages and grammars. At my school it was called (creatively) Theoretical Computer Science.
Learning to break apart a regex and rebuild it as a state machine is where the real magic happens.