My goal is to replace all instances of the substring "test_" to "append.test_". This can occur multiple times in a sentence. For example:
I am test_a and test_b => I am append.test_a and append.test_b
The problem is that I can have something like this
I am test_a and I am test_b_test_c
I can't figure out the right regex because when I try to use
my_string.gsub('test_', "append.test_")
it returns
I am append.test_a and I am append.test_b_append.test_c
My expected result:
I am append.test_a and I am append.test_b_test_c
Any ideas?