#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)((?:[a-zA-Z0-9]+)? ?(?:[Ll]ist|[Tt]able|[Ff]igure)).*?((?:[0-9]+\-[0-9]+)|(?<!-)[0-9]+): (.*)"
Local $sString = "Text Table 6-2: Management of children study and actions" & @CRLF & _
"Table 6-2: Management of children study and actions" & @CRLF & _
"table 6-2: Management of children study and actions" & @CRLF & _
"tezt Text Table 6-22: Management of children study and actions" & @CRLF & _
"Tezt text table 66-2: Management of children study and actions" & @CRLF & _
"tezt Text List / 6-2: Management of children study and actions" & @CRLF & _
"Text list 6-2: Management of children study and actions" & @CRLF & _
"Table 6-2: Management of children study and actions" & @CRLF & _
"table 6-2: Management of children study and actions" & @CRLF & _
"tezt Text figure 6-22: Management of children study and actions" & @CRLF & _
"Tezt text Figure 66-2: Management of children study and actions" & @CRLF & _
"tezt Text Table / 6-2: Management of children study and actions" & @CRLF & _
"table: 66-22: Management of children study and actions" & @CRLF & _
"tezt Text Table 6-22: Management of children study and actions" & @CRLF & _
"tezt Text Table 6: Management of children study and actions" & @CRLF & _
"able 6-2: Management of children study and actions" & @CRLF & _
"re hable 6-2: Management of children study and actions" & @CRLF & _
"table 62: Management of children study and actions" & @CRLF & _
"table 62-: Management of children study and actions" & @CRLF & _
"table -2: Management of children study and actions" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"" & @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