Ok, on the one hand, you should be able to answer the question with, "Get a standard-issue POSIX-conformant regex library. Next question!"
On the other hand, knowing that DFAs are equivalent to regexes are equivalent to NFAs is already a step of theoretical knowledge that any "Just let me write code" so-called "dev" is likely to complain about being asked for.
I was asked that question about 7 years after reading Mastering Regular Expressions and about 10 years after taking Automata in college. It so happens that I am an expert in regex, have a patent in the field, regularly answer stackoverflow regex questions for fun, etc. Unfortunately, the question involved me actually drawing a DFA, trying to remember the notation, etc. At this point I don't even remember the particular question, only that I couldn't remember how to draw or read the diagrams.
The interviewer told me this was a favorite question of his. Also I don't think I presented myself as a regex expert to them. Anyhow, I'm an expert in regex like a DBA would be an expert in SQL or particular databases. The interview was for an ordinary software engineer role.
Regardless, I only meant to make the point that I disagree with the comment "They're more interested in how you approach real world issues" and that this statement is false: "It's not like they get you in a room and ask you to draw a linked list or a binary tree"
edit: by "expert" I just mean something I'm particularly skilled in, not something I'm an authority in from theory to practice.
On the other hand, knowing that DFAs are equivalent to regexes are equivalent to NFAs is already a step of theoretical knowledge that any "Just let me write code" so-called "dev" is likely to complain about being asked for.