Regular Expressions in C – Having Trouble with the Pipe ‘|’ Character?

I was working on an assignment for my C class recently and spent an inordinate amount of time solving a simple problem with regular expressions. Hopefully this quick post will help save someone else the frustration.
Let’s say you have the regular expression Cat|Dog|Horse (should match Cat OR Dog OR Horse). You compile the regex using
char* [...]

Also tagged ,