Question: I learnt that C gets translated to assembly and then assembly gets translated to machine code. And I learnt how to translate basic C constructs such as pointers and loops to 32-bit MIPS assembly. But I didn't learn how to translate regexes in for instance C to assembly, is there a recipe?

Answer: 
C does not support regexes. Neither does assembly. You have to write some algorithmic code for pattern matching, and then, if it's not already in assembly/machine code, translate/compile into it. No magic.
Generally, it depends on how you implement regular expressions. You can, for example:

* Use something like PCRE or the POSIX regular expressions. In this case then the function calls to that API are simply translated to machine (assembly) code by making the proper calls using the calling convention specific to your architecture / ABI.
* Use a tool like `flex`. In this case, the tool will generate a large amount of C code, typically in the form of tables and a state machine, and this code will be translated using the compiler.

If you implement some kind of ad hoc regular expression parsing scheme, it will simply be whatever the compiler generates for your code.