#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)\d+ - (\w+(?: \w+)+) \(\d{4}-\d{4}\)"
Local $sString = "50 - David Herd (1961-1968)" & @CRLF & _
"49 - Teddy Sheringham (1997-2001)" & @CRLF & _
"48 - George Wall (1906-1915)" & @CRLF & _
"47 - Stan Pearson (1935-1954)" & @CRLF & _
"46 - Harry Gregg (1957-1966)" & @CRLF & _
"45 - Paddy Crerand (1963-1971)" & @CRLF & _
"44 - Jaap Stam (1998-2001)" & @CRLF & _
"43 - Paul Ince (1989-1995)" & @CRLF & _
"42 - Dwight Yorke (1998-2002)"
Local $sSubst = "$1"
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