#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?s)<a.*?href=\"(.+?.pdf\?min)\".*?>(.*?)<\/a>"
Local $sString = "<table cellspacing="0" cellpadding="0" width="100%" border="0">" & @CRLF & _
" <tbody>" & @CRLF & _
" <tr>" & @CRLF & _
" <td width="25%"><a href="http://www.test.com/myfile.pdf?min" target="_blank">Menus 18 €</a></div></td>" & @CRLF & _
" <td width="25%"><a href="http://www.test.com/myfile.pdf?min" target="_blank">Menus 24 et 26 €</a></div></td>" & @CRLF & _
" <td width="25%"><a href="http://www.test.com/myfile.pdf?min" target="_blank">Menus 30 et 37 € </a></div></td>" & @CRLF & _
" <td width="25%"><a href="http://www.test.com/myfile.pdf?min">La Carte détaillée <br>" & @CRLF & _
" (Entrées - Viandes - Poissons)</a></td>" & @CRLF & _
" </tr>" & @CRLF & _
" </tbody>" & @CRLF & _
"</table>"
Local $sSubst = "ok"
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