#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?mu)(?<!検索結果:)(?<!次の)(?<![0-90-9])(?<![0-90-9][,,、])(?:[〇一二三四五六七八九十百千万億兆0-90-9]|京+)[,,、]?.+[〇一二三四五六七八九十百千万億兆京0-90-9].+件"
Local $sString = "Issue: with the original regex pattern, everything mathes (numbers + 件), but those that shouldn't partially match as you see below. " & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"******************************************" & @CRLF & _
"*THESE BELOW SHOULD MATCH (just the numbers + 件)*" & @CRLF & _
"" & @CRLF & _
"販売実績100万件" & @CRLF & _
"販売実績100万件" & @CRLF & _
"販売実績1,000件" & @CRLF & _
"販売実績1,000件" & @CRLF & _
"販売実績1,000,000件です" & @CRLF & _
"100,000件" & @CRLF & _
"5000件" & @CRLF & _
"" & @CRLF & _
"******************************************" & @CRLF & _
"" & @CRLF & _
"*BELOW PATTERNS SHOULD NOT MATCH*" & @CRLF & _
"" & @CRLF & _
"(☓)検索結果:10件" & @CRLF & _
"(x)検索結果:500件" & @CRLF & _
"(x)次の100件" & @CRLF & _
"(☓)10件表示" & @CRLF & _
"(☓)10件を表示" & @CRLF & _
"(☓)10件の表示" & @CRLF & _
"(x)全件" & @CRLF & _
"" & @CRLF & _
"(x)検索結果:13953952件 <--- problem" & @CRLF & _
"(x)検索結果:100,000,000件 <--- problem" & @CRLF & _
"(x)検索結果:5000件" & @CRLF & _
"(x)次の5,000件" & @CRLF & _
"(x)次の5,0000件 <--- problem" & @CRLF & _
"(x)次の1000件" & @CRLF & _
"(x)次の5万件"
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