#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)(\(\d+), '(.*?)(?:[|]{3}.*?)?', (\d+\),?)"
Local $sString = "(37, '2011-01/1295144032_x_7cb0bcf1.jpg|||2011-01/1295266037_small_carterthal1.jpg.jpg|||2014-05/1401429739_3-fundamenta-vidyatshih2.jpg', 66)," & @CRLF & _
"(38, '2011-01/1295266433_event-image-poster.jpg|||2011-01/1295279508_16f7cb40.jpg', 67)," & @CRLF & _
"(39, '2012-01/1295277340_1.jpg|||2011-01/1295278172_08a9e04f4264-300x298.jpg|||2014-05/1401428634_vladislav-erko-castaneda-9.jpg', 68)," & @CRLF & _
"" & @CRLF & _
"(68, '2011-03/1300177205_usui.jpg', 393)," & @CRLF & _
"(37, 'upload/2011-01/1295144032_x_7cb0bcf1.jpg', 66)," & @CRLF & _
"(38, 'upload/2011-01/1295266433_event-image-poster.jpg', 67)," & @CRLF & _
"(39, 'upload/2012-01/1295277340_1.jpg', 68),"
Local $sSubst = "$1, 'upload/$2', $3"
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