Hello,

First post!

I'd like to use the bottom part of a text file that contains my code. I want to be able to ovewrite everything between the last bracket } to the End Of File.


Here is an example of the file I want to modify:

init.pp
Code:
class stunnel  {
        define stunnel-server ()
        {
        }
}

#THIS IS THE AREA I WANT MY REG EXPRESSION TO MODIFY
I created this ruby script to edit the bottom end of the document but I can't figure out the correct code/regular expression but it is not correct.

Code:
        mystring = ''
        File.open("init.pp", "r") { |f|
                mystring = f.read
        }

        mystring =mystring.string.gsub("(?<=})[^}]*" , "#NEW TEXT")
        
       #code to write mystring back to init.pp file
What is the correct regular expression?

Thanks