Within a method, I want to dynamically evaluate the following code chunk with a regex:
if (/^[A-F][A-Z]*[^\.\*]$/).match(some_value)
The method I attempted is this:
def check(val)
if (/^[val][A-Z]*[^\.\*]$/).match(some_value)
puts "foo"
else
puts "waa"
end
end
check("A-F")
The value I am passing in is not making it there correctly. It appears that passing a value in this fashion needs something more. Is this not something you can do with a method?
.or*inside[...].[^.*]will suffice.