That's what I figured I'd have to use. I was put off from them because I had to use one in another project I worked on and I had no idea exactly how it worked. I guess I'll have to take the time to learn about them. Thanks!
TBF, they can be a pain in the ass. There's a saying about people who, when confronted with a problem, think
“I know, I'll use regular expressions.” Now they have two problems.
But they are an incredibly useful tool for the kind of work you're describing.
Yup. Regular expressions are powerful and important to understand, but it's just as important to understand when NOT to use them.
Too many people see them as a cure-all solution for parsing-related problems, completely ignorant to the fact that regular expressions and the grammars they define are the simplest form of grammar (functionally equivalent to finite state machines), and thus there are many problems for which they are only a partial solution at best (such as parsing natural languages).
For example, they're great for extracting social security numbers or phone numbers from text, and decent (if extremely complex) at validating e-mail addresses, but totally incapable of validating C code.