Relative Content

Tag Archive for regexrubymarkdownliquid

Ruby Regex – Match exactly N backticks with exactly N backticks

I think I have found the solution to a GitHub issue, but it involves a bit of advanced RegEx in Ruby. (I rarely worked with Ruby and I wouldn’t call myself a professional in RegEx). The problem is that when you have let’s say 5 (anything above 3) opening backticks then the parser encounters 3 backticks, it will automatically close the code block. Basically the code is as follows:

Ruby Regex – Match exactly N backticks with exactly N backticks

I think I have found the solution to a GitHub issue, but it involves a bit of advanced RegEx in Ruby. (I rarely worked with Ruby and I wouldn’t call myself a professional in RegEx). The problem is that when you have let’s say 5 (anything above 3) opening backticks then the parser encounters 3 backticks, it will automatically close the code block. Basically the code is as follows: