def _sub_all_refs(self, text, handler_method):
<EOL>logical_id_regex = '<STR_LIT>'<EOL>ref_pattern = re.compile(r'<STR_LIT>' + logical_id_regex + '<STR_LIT>')<EOL>return re.sub(ref_pattern,<EOL>lambda match: handler_method(match.group(<NUM_LIT:0>), match.group(<NUM_LIT:1>)),<EOL>text)<EOL>
Substitute references within a string that is using ${key} syntax by calling the `handler_method` on every
occurrence of this structure. The value returned by this method directly replaces the reference structure.

Ex:
    text = "${key1}-hello-${key2}
    def handler_method(full_ref, ref_value):
        return "foo"

    _sub_all_refs(text, handler_method) will output "foo-hello-foo"

:param string text: Input text
:param handler_method: Method to be called to handle each occurrence of ${blah} reference structure.
    First parameter to this method is the full reference structure Ex: ${LogicalId.Property}.
    Second parameter is just the value of the reference such as "LogicalId.Property"

:return string: Text with all reference structures replaced as necessary