#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^(?:.*[\/\\])?(?<FileNameWithoutExtension>.*)\.(.*?(?=\#|\?|$))"
Local $sString = "http://www.cultureandcosmos.org/pdfs/2-2/Voss_Music_Spheres.pdf#456" & @CRLF & _
"" & @CRLF & _
"https://static1.squarespace.com/static/58d6b5ff86e6c087a92f8f89/t/5913df9915cf7db9454ad94a/1494474655305/Plato_and_Hesiod.pdf#page=270" & @CRLF & _
"" & @CRLF & _
"http://www.cultureandcosmos.org/pdfs/2-2/Voss_Music_Spheres.pdf?power=222p#11" & @CRLF & _
"" & @CRLF & _
"https://archive.flossmanuals.net/inkscape/_booki/inkscape/inkscape.pdf" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"Taylor Swift - New Romantics.m4a" & @CRLF & _
"YT/Subto2mp3/Taylor Swift - New Terribly Romantics.m4a" & @CRLF & _
"Grow - Conan Blue (Official Video) has already been recorded in archive.m4a" & @CRLF & _
"PowerOptim Iol/Techno/(Official Video) Blue Burrow was already been recorded in archive - Bak.wm4" & @CRLF & _
"/Great Bun/Output Files/çè/Grow - Conan DARK (Official AUDIO) has already been recorded in archive.m4b" & @CRLF & _
"Matter Oil_9999.zip" & @CRLF & _
"Qpl$-pol.hrlp/perm.ui.pol/i op/doesn't matter.mp4" & @CRLF & _
"Small Laser4.m4a" & @CRLF & _
"manicur pliu/love is in the a°°_II+?§@R.txt" & @CRLF & _
"^Level09\\Power Pol\energy.m4a" & @CRLF & _
"lollller_blllade 1987 (c)/super €/music_piece_.mp3" & @CRLF & _
"\.\.$./../../loli( u1990) _98.lop.pl/fil l/fill2asm.aile.asm.gz.zip" & @CRLF & _
"/Taylor Swift - New Romantics._m4a" & @CRLF & _
"\$/Subto2/mp3/Taylor Swift -&- New Romantics.m4a" & @CRLF & _
"/Grow - Conan Gray (Official Video) has already been recorded in archive.m4a" & @CRLF & _
"C:\PowerOptim Iol/Grow - The New Gray (Official Video) has been recorded [<1999>.wm4" & @CRLF & _
"/Great Bun/Output Files/çè/Grow - WiLlL(O)W Gray "unofficial" video has not been recorded in archive.m4b" & @CRLF & _
"/Matter Oil_9999.zip" & @CRLF & _
"file:///Qpl$-pol.hrlp/perm.ui.pol/i op/matter.mp4" & @CRLF & _
"/£¥«^6<4>à_»Laser4 ``[12{2%}32]deg`‘.webm" & @CRLF & _
"manicur pliu/great.power.great.responsibility?.gz.tar.zip" & @CRLF & _
"./poi kiol/greater.power.greater.responsibility!.gz.tar.zip" & @CRLF & _
"^Level09\Power Pol\energy.m4a" & @CRLF & _
"lollller_blllade 1987 (c)/super €/music_piece_.mp3" & @CRLF & _
"/The 'great' solitude of zorro #12/the 退ellent urge_for.mo.tar.gz" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
""
Local $aArray = StringRegExp($sString, $sRegex, $STR_REGEXPARRAYGLOBALFULLMATCH)
Local $aFullArray[0]
For $i = 0 To UBound($aArray) -1
_ArrayConcatenate($aFullArray, $aArray[$i])
Next
$aArray = $aFullArray
; Present the entire match result
_ArrayDisplay($aArray, "Result")
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