#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)[\#(/)_\-\=\!\:]"
Local $sString = "#/usr/bin/python3" & @CRLF & _
"from bisect import bisect_right" & @CRLF & _
"" & @CRLF & _
"def binary_search(vector,x):" & @CRLF & _
" i = bisect_right(vector,x)" & @CRLF & _
" if i != len(vector)+1 and vector[i-1] == x:" & @CRLF & _
" return i-1" & @CRLF & _
" return -1" & @CRLF & _
" " & @CRLF & _
"def is_prime(vector,number):" & @CRLF & _
" return 1 if binary_search(vector,number) != -1 else 0 " & @CRLF & _
" " & @CRLF & _
"def prime_vector(num):" & @CRLF & _
" ret = []" & @CRLF & _
" for a in range(2,num+1):" & @CRLF & _
" if a == 2 or a == 3 or a == 5 or a == 7 or a == 11:" & @CRLF & _
" ret.append(a)" & @CRLF & _
" elif a %2 == 0 or a%3 == 0 or a%5 == 0 or a%7==0 or a%11 == 0:" & @CRLF & _
" continue" & @CRLF & _
" else:" & @CRLF & _
" ret.append(a)" & @CRLF & _
" return ret" & @CRLF & _
" " & @CRLF & _
"number = int(input())" & @CRLF & _
"prime = prime_vector(number)" & @CRLF & _
"ret = []" & @CRLF & _
"p = 0" & @CRLF & _
"" & @CRLF & _
"while number:" & @CRLF & _
" if is_prime(prime,number):" & @CRLF & _
" ret.append(number)" & @CRLF & _
" break" & @CRLF & _
" elif number%prime[p] == 0:" & @CRLF & _
" ret.append(prime[p])" & @CRLF & _
" number = int(number / prime[p])" & @CRLF & _
" else:" & @CRLF & _
" p = p + 1" & @CRLF & _
" " & @CRLF & _
"for a in range((len(ret))):" & @CRLF & _
" print(ret[a],end=" ")" & @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