#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)(?x) # free-spacing mode" & @CRLF & _
"(?(DEFINE) " & @CRLF & _
" # decimal to decimal: 1.2% to 21.53%" & @CRLF & _
" (?<dec_to_dec>" & @CRLF & _
" (?:[0-9]{1,3}[\,\.][0-9]{1,3}[\%]\sto\s[0-9]{1,3}[\,\.][0-9]{1,3}[\%])" & @CRLF & _
" ) " & @CRLF & _
" # Decimal to Whole number: 1.2% to 21%" & @CRLF & _
" (?<dec_to_int>" & @CRLF & _
" (?:[0-9]{1,3}[\,\.][0-9]{1,3}[\%]\sto\s[0-9]{1,3}[\%])" & @CRLF & _
" )" & @CRLF & _
" # Whole number to Decimal: 1% to 21.53%" & @CRLF & _
" (?<int_to_dec>" & @CRLF & _
" (?:[0-9]{1,3}[\%]\sto\s[0-9]{1,3}[\,\.][0-9]{1,3}[\%])" & @CRLF & _
" )" & @CRLF & _
" # Whole number to whole number: 1% to 21%" & @CRLF & _
" (?<int_to_int>" & @CRLF & _
" (?:[0-9]{1,3}[\%]\sto\s[0-9]{1,3}[\%])" & @CRLF & _
" ) " & @CRLF & _
" # Single Whole Number: 21%" & @CRLF & _
" (?<single_int>" & @CRLF & _
" (?:[0-9]{1,3}[\%])" & @CRLF & _
" )" & @CRLF & _
" # Single Whole Number: 21%" & @CRLF & _
" (?<single_dec>" & @CRLF & _
" (?:[0-9]{1,3}[\,\.][0-9]{1,3}[\%])" & @CRLF & _
" )" & @CRLF & _
")" & @CRLF & _
"(?&dec_to_dec)|(?&dec_to_int)|(?&int_to_dec)|(?&int_to_int)|(?&single_int)|(?&single_dec)"
Local $sString = "France: 2.8% to 21%"
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