Quantcast
Viewing all articles
Browse latest Browse all 65

Can regex be compiled into efficient machine code?

Most languages that have regex have a regex parsing library that interprets the regex at runtime and matches them to strings. I am a fan of eliminating as much runtime overhead as possible, and as such, sometimes write string matching functions by hand instead of using regex.

What would it take for a language to 'compile' regex at compile time to be as efficient as writing an equivalent string matching function by hand? Why do most languages not do this? What would be the advantages or disadvantages of having regex as a core language feature as opposed to a library function?


Viewing all articles
Browse latest Browse all 65

Trending Articles



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