I am new to Ruby so sorry if it's a simple question. I want to open a ruby file and search all constants, but I don't know the right regular expression.
Here is my simplified code:
def findconst()
filename = @path_main
k= {}
akonstanten = []
k[:konstanten] = akonstanten
if (File.exists?(filename))
file = open(filename, "r")
while (line = file.gets)
if (line =~ ????)
k[:konstanten] << line
end
end
end
end
MAGIC_STRING = "This is a word in CAPS"? How many constants do you see here?