#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?P<core1>(?i)[A-Z0-9]+)[\s]?((?i)out of|of|\/)[\s]?(?P<core2>(?i)[A-Z0-9]+)[\s]?(?:(?i)core[s]?|needle core[s]?)"
Local $sString = "ajnxaslndsa;ndaJDASDNsadnKDNadk;NADK'nadkAnaskdmaskdnajfbajfnakdnaj;knasjnakdna;jkdna;nda;dna;kdnas;dkns" & @CRLF & _
"so as sadasldka aldaskl . asdas asd 5,400 cgy" & @CRLF & _
"40.00 cgy" & @CRLF & _
"4 cgy" & @CRLF & _
"gleason score 6/10(4+3), = 7 )" & @CRLF & _
"1.1- 0.6,df" & @CRLF & _
"2,4-3,6 asdf 4+5+6" & @CRLF & _
"gleason's pattern: 2+3, 5" & @CRLF & _
"gleason score = 5(2+3)" & @CRLF & _
"score 1+2, (score 7)" & @CRLF & _
"gleason Dec 2011-23 jan" & @CRLF & _
"500,000.012 cgy sdfsfsodm sdfsd f" & @CRLF & _
"sdfsd afdas. s adasas dasd as" & @CRLF & _
"asdasdaskd askdm askdmas'ljdnas;das.ndaskjndajkndWJDNAksz" & @CRLF & _
"" & @CRLF & _
"(?P<core1>(?i)[A-Z0-9]+)[\s]?((?i)out of|of|\/)[\s]?(?P<core2>(?i)[A-Z0-9]+)[\s]?(?:(?i)core[s]?|needle core[s]?)" & @CRLF & _
"(?P<core1>(?i)[A-Z0-9]+)[\s]?((?i)core[s]? out of)[\s]?(?P<core2>(?i)[A-Z0-9]+)" & @CRLF & _
"(?:(?i)involving)[\s]?(?P<core1>(?i)[A-Z0-9]+)[\s]?(?:(?i)core[s]?|needle core[s]?)" & @CRLF & _
"" & @CRLF & _
"1 of 3 core" & @CRLF & _
"one of three cores" & @CRLF & _
"involving 1/2 cores" & @CRLF & _
"involving five of six cores" & @CRLF & _
"two of the cores" & @CRLF & _
"one of multiple cores" & @CRLF & _
"1 of multiple cores" & @CRLF & _
"two of 4 cores" & @CRLF & _
"5 of six cores" & @CRLF & _
"(1/8 needle cores)" & @CRLF & _
"(3/7 cores)" & @CRLF & _
"one out of six cores" & @CRLF & _
"two cores out of two" & @CRLF & _
"1 core out of 2" & @CRLF & _
"involving 1 core" & @CRLF & _
"involving two cores" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"gleason score 9, 4+5=9/10," & @CRLF & _
"" & @CRLF & _
"PSA = 27.60, 8 specimens" & @CRLF & _
"" & @CRLF & _
"{0,1SDf00}" & @CRLF & _
"" & @CRLF & _
"10% 20%" & @CRLF & _
"" & @CRLF & _
"(?<=(?i)gleason)[\w\s\p{P}\=]*[^0-9\.\+]*\s*\K(\d)\s*\+\s*(\d)(?=\D)" & @CRLF & _
"" & @CRLF & _
"(?<=(?i)gleason)[\w\s\p{P}\=]*[^0-9\.\+]*\s*\K(\d)\s*\+\s*(\d)(?=\D)" & @CRLF & _
"(?<=(?i)gleason)[\w\s\p{P}\=]*[^0-9\.\-]*\s*\K(\d)\s*\-\s*(\d)(?=\D\-)" & @CRLF & _
"(?<=(?i)gleason)[\w\s\p{P}\=]*[^0-9\.\,\#]*\s*\K(\d)\s*\,\s*(\d)(?=\D)" & @CRLF & _
"[\w\s\p{P}\=]*[^0-9\.\+]*\s*\K(\d)\s*\+\s*(\d)(?=\D)" & @CRLF & _
"[\w\s\p{P}\=]*[^0-9\.\-]*\s*\K(\d)\s*\+\s*(\d)(?=\D\-)" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"(?<=[\\s])\\s*|^\\s+|\\s+$" & @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