data.to_enum(:scan,/(#entity[0])/i).map do |m,|
p $`.size
How can I use dynamic variable in regular expression?
#entity[0] returns a value, but in the above syntax #entity[0] is taken literally in the regex.
data.to_enum(:scan,/(#entity[0])/i).map do |m,|
p $`.size
How can I use dynamic variable in regular expression?
#entity[0] returns a value, but in the above syntax #entity[0] is taken literally in the regex.