R
Rick Jones
This should be (and probably will be) a simple answer, but if I have the
very basic program of:
#!/usr/bin/ruby
require
arg = ARGV[0]
regex = /"#{arg}"/
regex1 = /Test/
a = "this is a Test"
if regex =~ a
puts "test works"
else
puts "test isn't working"
end
With this code, if i inputs ./filename 'Test', how can i get the regex
to be correct? I can only think of using the "#{}" to put this inside
the expression, but this puts the parenthesis around it...
very basic program of:
#!/usr/bin/ruby
require
arg = ARGV[0]
regex = /"#{arg}"/
regex1 = /Test/
a = "this is a Test"
if regex =~ a
puts "test works"
else
puts "test isn't working"
end
With this code, if i inputs ./filename 'Test', how can i get the regex
to be correct? I can only think of using the "#{}" to put this inside
the expression, but this puts the parenthesis around it...