#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)(?<=\/)(?=[^\/\n]{0,6}path)[^\/]{10}\/"
Local $sString = "d:/KeepItSimple/1234path21/WAVs/filename.wav" & @CRLF & _
"d:/TryToKeepItSimple/5678path23/WAVs/filename2.wav" & @CRLF & _
"d:/Simpler/path567823/WAVs/filename2.wav" & @CRLF & _
"d:/TooShort/path56782/WAVs/filename2.wav" & @CRLF & _
"d:/TooLong/path5678234/WAVs/filename2.wav" & @CRLF & _
"d:/pathNotPresent/5678pat23/f3.wav" & @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