#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)(?<! - )((?:Jul|Aug)\W\d+\W+\d+)(?!.*(?:Jul|Aug)\W\d+\W+\d+)"
Local $sString = "Jul 31, 2015 - Aug 27, 2015 | " & @CRLF & _
"Itinerary # 1110473023685 Amman (AMM) ? Chicago (ORD) Jul 31, 2015 - Aug 27, 2015 , 1 round trip ticket " & @CRLF & _
"NOT BOOKED This flight is not booked. Book now to guarantee price and availability. " & @CRLF & _
"Traveler Information Adult No frequent flyer details provided " & @CRLF & _
"* Seat assignments, special meals, frequent flyer point awards and special assistance requests should be confirmed directly with the airline." & @CRLF & _
"Jul 31, 2015 - Departure 2 stops Total travel time:20 h 40 m " & @CRLF & _
"Amman Paris 5 h 0 m 2,097 mi AMM 1:30am CDG 5:30am Terminal 2E Airport check-in with Air France Delta 8429 Operated by Air France Economy / Coach (B)" & @CRLF & _
"" & @CRLF & _
"aris Amsterdam 1 h 15 m 247 mi CDG 8:45am Terminal 2F AMS 10:00am Delta 9429 Operated by KLM Economy / Coach (B) | Confirm seats with the airline " & @CRLF & _
"* Layover: 2 h 40 m " & @CRLF & _
"Amsterdam Chicago 8 h 30 m 4,112 mi AMS 12:40pm ORD 2:10pm Terminal 5 Delta 9382 Operated by KLM Economy / Coach (B) | Confirm seats with the airline " & @CRLF & _
"* Aug 26, 2015 - Return 1 stop Total travel time:19 h 0 m Chicago " & @CRLF & _
"Paris 8 h 15 m 4,148 mi ORD 5:20pm Terminal 5 CDG 8:35am +1 day Terminal 2E Air France 489 Economy / Coach (N) | Confirm seats with the airline " & @CRLF & _
"* Layover: 6 h 10 m Paris Amman 4 h 35 m 2,097 mi CDG 2:45pm Terminal 2E AMM 8:20pm (Arrives on Aug 27, 2015) " & @CRLF & _
"Air France 3840 Economy / Coach (N) | Confirm seats with the airline * Airline Rules & Regulations · " & @CRLF & _
"This price includes a nonrefundable booking fee. · " & @CRLF & _
"We understand that sometimes plans change. We do not charge a cancel or change fee. When the airline charges such fees in accordance with its own polic" & @CRLF & _
"ies, the cost will be passed on to you. · " & @CRLF & _
"nonstop" & @CRLF & _
"" & @CRLF & _
"Price Summary Traveler 1: Adult $1,901.20 Flight $1,267.00 Taxes & Fees $634.20 Expedia Booking Fee $7.00 Total: $1,908.20 All prices quoted in US dollars. "
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