Quantcast
Channel: Active questions tagged ocaml - Stack Overflow
Viewing all articles
Browse latest Browse all 528

How does a compiler determine whether a string matches a regex or not? [closed]

$
0
0

I've recently been learning about compilers, more specifically Ocaml ones, and I was wondering how does the compiler actually determine which regex a string matches. Does it build a DFA for each regex defined by the lexer and then test each string on each DFA until it finds a match or is there some other algorithm/intuition.

Couldn't find a clear answer online


Viewing all articles
Browse latest Browse all 528

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>