#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(#EXTM3U\s+|#EXTINF:\d+,|(.*\.\w{3,4}).*\s+)"
Local $sString = "#EXTM3U" & @CRLF & _
"#EXTINF:419,Alice in Chains - Rotten Apple" & @CRLF & _
"http://192.168.101.22:80/movies/9975.mkv" & @CRLF & _
"#EXTINF:260,Alice in Chains - Nutshell" & @CRLF & _
"http://192.168.101.22:80/movies/1254.mkv" & @CRLF & _
"#EXTINF:255,Alice in Chains - I Stay Away" & @CRLF & _
"http://192.168.101.22:80/movies/1254.mkv" & @CRLF & _
"#EXTINF:256,Alice in Chains - No Excuses" & @CRLF & _
"Alice in Chains_Jar of Flies_04_No Excuses.mp3" & @CRLF & _
"#EXTINF:157,Alice in Chains - Whale And Wasp" & @CRLF & _
"Alice in Chains_Jar of Flies_05_Whale And Wasp.mp3" & @CRLF & _
"#EXTINF:263,Alice in Chains - Don't Follow" & @CRLF & _
"Alice in Chains_Jar of Flies_06_Don't Follow.mp3" & @CRLF & _
"#EXTINF:245,Alice in Chains - Swing On This" & @CRLF & _
"Alice in Chains_Jar of Flies_07_Swing On This.mp3" & @CRLF & _
""
Local $sSubst = ""
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