#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)(^reflectance_\d_)(\S*)$"
Local $sString = "reflectance_7_myd21a1_emissivity_29" & @CRLF & _
"reflectance_7_myd21a1_emissivity_29_savitzkygolay" & @CRLF & _
"reflectance_7_myd21a1_emissivity_31" & @CRLF & _
"reflectance_7_myd21a1_emissivity_31_savitzkygolay" & @CRLF & _
"reflectance_3_myd21a1_emissivity_32" & @CRLF & _
"reflectance_2_myd21a1_emissivity_32_savitzkygolay" & @CRLF & _
"reflectance_1_mcd43a3_albedo_bsa_band1" & @CRLF & _
"reflectance_3_mcd43a3_albedo_bsa_band2" & @CRLF & _
"reflectance_7_mcd43a3_albedo_bsa_nir" & @CRLF & _
"reflectance_7_mcd43a3_albedo_bsa_shortwave" & @CRLF & _
"reflectance_7_mcd43a3_albedo_bsa_vis" & @CRLF & _
"reflectance_7_mcd43a3_albedo_wsa_band1" & @CRLF & _
"reflectance_7_mcd43a3_albedo_wsa_band2" & @CRLF & _
"reflectance_7_mcd43a3_albedo_wsa_nir" & @CRLF & _
"reflectance_7_mcd43a3_albedo_wsa_shortwave" & @CRLF & _
"reflectance_7_mcd43a3_albedo_wsa_vis"
Local $sSubst = "($1)vs_$2"
Local $sResult = StringRegExpReplace($sString, $sRegex, $sSubst)
MsgBox($MB_SYSTEMMODAL, "Result", $sResult)
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for AutoIt, please visit: https://www.autoitscript.com/autoit3/docs/functions/StringRegExp.htm