Get the latest tech news
The /o in Ruby regex stands for "oh the humanity "
Your code using the /o modifier Source: wikipedia Hi there! Do you like Regex? Do you like performance? Do you like creating confounding bugs for yourself rooted in the mechanics of the Ruby VM itself? If you said yes to all of the above, have I got a feature for you! But first, let’s start with a story. The cliffs of insanity I was recently reviewing some code, and part of the functionality was about matching.
With nothing else to investigate, I finally looked up the docs for what the/o regex modifier does./o is referred to as “Interpolation mode”, which sounded pretty harmless. It contains all of the available YARV (Yet Another Ruby VM) instructions in a C-esque format which is compiled into an actual C file as part of building the language. In a moment of pure serendipity, the day after I started writing this post I happened to read Jared Norman’s Code Reloading for Rack Apps.
Or read this on Hacker News