#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)(^[^\\]*)\\t([^\\]*)\\t([^\\]*)\\t([^\\]*)\\t([^\\]*)(.*)"
Local $sString = "19-22\t\t4\tP,G\tDOB_TT\t\tTime of Birth\t\t126\t \t0000-2359 Time of Birth" & @CRLF & _
"24-25\t\t2\tT,G\tOSTATE\t\tOccurrence Postal State" & @CRLF & _
"85-86\t\t2\tG\tMRCNTRY\tMother’s Residence Country\t\tAA-ZZ\tSee Geographic Documentation" & @CRLF & _
"87-88\t\t2\tG\tXMRSTATE\tExpanded State of Residence of Mother\t\t" & @CRLF & _
"108-109\t\t2\tP,G\tMRACE_R15\tMother’s Race Recode 15\t\t\t" & @CRLF & _
"151-152\t\t2\tP,G\tFRACE_R31\tFather’s Race Recode 31\t\t\t01\tWhite (only) [only one race reported]"
Local $sSubst = "\5"
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