Change in string / regex behavior with cmake 4.3

A package I’m building has:

      FILE(STRINGS "${_H5_I_PUB_ABS_PATH}" _h5_i_pub_contents)
      FOREACH(_line IN LISTS _h5_i_pub_contents)
        SET(_match)
        STRING(REGEX MATCH "^[ \t]*typedef .*hid_t.*" _match "${_line}")
        IF(_match)
          SET(HDF5_TYPEDEF_HID_T "${_match}")
          BREAK()
        ENDIF()
      ENDFOREACH()

and then used to create a templated file with:

@HDF5_TYPEDEF_HID_T@

So it’s matching the following line:
typedef int64_t hid_t;

Prior to 4.3 that line would be output verbatim, but now it strips the trailing semi-colon:

typedef int64_t hid_t

Is this expected? How can I avoid it?

This seems unexpected to me. Could you please open a bug report in CMake’s issue tracker with the above information?