Do interpreters and compilers compare (and ultimately match) two strings for a potential match in a character-by-character and left-to-right fashion? Or is there an underlying
The way regular expressions work is an implementation detail. They can be implemented one way, or second way.
In fact, some of the languages implement them inefficiently.
If you want to understand more, I can refer you to this article: https://swtch.com/~rsc/regexp/regexp1.html