#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)^/(forum/|cms/|wcf/|calendar/|filebase/|blog/|gallery/)?([^.\n]+)$"
Local $sString = "/article/7-where-to-find-the-new-pve-elite-skills/" & @CRLF & _
"/forum/" & @CRLF & _
"/forum/thread/1409-lgit-legit-guild-lgit/?pageNo=6" & @CRLF & _
"/forum/thread/2956-chat-filter-filter-out-gold-spammers/" & @CRLF & _
"/forum/thread/1607-minions-of-the-rabbit-legion-pupu/" & @CRLF & _
"/forum/thread/1607-minions-of-the-rabbit-legion-pupu/?action=firstNew" & @CRLF & _
"/forum/?action=firstNew "
Local $sSubst = "/${1}index.php?${2}"
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