#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?i)(.*((\bown(er|re)\b)|(\bocc?up(eir|ier|ire)\b)s?).*)"
Local $sString = "customer_name" & @CRLF & _
"Miss. amber Lowe" & @CRLF & _
"Ms. zara scantlebury" & @CRLF & _
"Mrs. Jacky Kalonda" & @CRLF & _
"Mrs. Cynthia Williams" & @CRLF & _
"Mr. Suresh Kotecha" & @CRLF & _
"Rebecca Bormer" & @CRLF & _
"Mr. Affan Hashmi" & @CRLF & _
"Mr. William Dormand" & @CRLF & _
"Mr. Andrew MacIntosh" & @CRLF & _
"Mr. Kieran Ross" & @CRLF & _
"Mrs. rachel pezerovic" & @CRLF & _
"Mr. David Abbott" & @CRLF & _
"Mrs. Fazal Jan Butt" & @CRLF & _
"Owner Occupier" & @CRLF & _
"Mrs. Barbara Feerick" & @CRLF & _
"Mr. Gary Rendell" & @CRLF & _
"Mrs. Natalie Farrell" & @CRLF & _
"Ms. Sally Janani" & @CRLF & _
"Mr. Chris Tween" & @CRLF & _
"Mr. Shahid Ali" & @CRLF & _
"Mr. Govanmurad saifi" & @CRLF & _
"Ms. Vera Lucia" & @CRLF & _
"Nicola Smith" & @CRLF & _
"Mr. Andrew Jessop" & @CRLF & _
"Ashley Phoenix" & @CRLF & _
"Mrs. Rosalie Cross" & @CRLF & _
"Ms. Patricia Smith" & @CRLF & _
"Martin Stewart" & @CRLF & _
"Mr. zakir nazmin" & @CRLF & _
"Owner Occupier" & @CRLF & _
"Mr. Leeanne Jasper" & @CRLF & _
"Owner Occupier" & @CRLF & _
". Mr Yousuf Munshi C/O Mrs Zulekhan Munshi" & @CRLF & _
"Owner Occupier" & @CRLF & _
"Miss. Gemma Johnson" & @CRLF & _
"Mr. Michael Brown" & @CRLF & _
"Owner Occupiers" & @CRLF & _
"Mr. paul atkins" & @CRLF & _
"Karen Taylor" & @CRLF & _
"Mr. Yusuf Hassan" & @CRLF & _
"Mrs Teresa Geeson" & @CRLF & _
"Mr. Paul Regan" & @CRLF & _
"Mrs Pat Robinson" & @CRLF & _
"Mr. Patrick Jones" & @CRLF & _
"Mrs. chapanben bava" & @CRLF & _
"Mr. Nadeem Tariq" & @CRLF & _
"Mr. Kiran Jayaprakash" & @CRLF & _
"Kris Henley" & @CRLF & _
"Mrs. Denise Gouge" & @CRLF & _
"Mr. Dilip Gurung" & @CRLF & _
"Owner Occupier" & @CRLF & _
"Miss Stephanie Hamman" & @CRLF & _
"Mr. Richard Sneddon" & @CRLF & _
"Mr. AvtarSingh Chauhan" & @CRLF & _
"Mr. Simon Smithen" & @CRLF & _
"Owner Occupier" & @CRLF & _
"Mr. Hussein Hydari" & @CRLF & _
"Mr. kirk wragg" & @CRLF & _
"Mr. Melvyn Orton" & @CRLF & _
"Mr. Derrick Moy" & @CRLF & _
"Miss. Jade Rogers" & @CRLF & _
"Mr. Adam Farnen" & @CRLF & _
"Mr. Mohammad Hossain" & @CRLF & _
"Lauran Kilpatrick" & @CRLF & _
"Mr. Dennis Buffrey" & @CRLF & _
"Mr. Bruce Jones" & @CRLF & _
"Mr. Phillip Christey" & @CRLF & _
"Christine Searle" & @CRLF & _
"Mr. Timothy Shaw" & @CRLF & _
"Mrs. yijia liu" & @CRLF & _
"Mr. Barry Nell" & @CRLF & _
"Mrs. Caroline Rabaiotti" & @CRLF & _
"Owner Occupier" & @CRLF & _
"Mrs. Hazel Bell" & @CRLF & _
"Craig Barrow" & @CRLF & _
"Mr. Mani Dhaliwal" & @CRLF & _
"Mr. Linda Maynard" & @CRLF & _
"Mrs. Amanda Jooma" & @CRLF & _
"Mr. eamon monaghan" & @CRLF & _
"Victoria Fairbourne" & @CRLF & _
"Mrs. Tasleem Akhtar" & @CRLF & _
"Mrs. Cheryl Woollett" & @CRLF & _
"Mr. Alexander Smith" & @CRLF & _
"Mrs. jane beaumont" & @CRLF & _
"Mr. david fergusson" & @CRLF & _
"Mr. Masood Ahmed" & @CRLF & _
"Clare Turner" & @CRLF & _
"Owner Occupier" & @CRLF & _
"Mr. Malcolm Hutchinson" & @CRLF & _
"Jim Stobo" & @CRLF & _
"Mr. richard upton" & @CRLF & _
"Mr. David Canvin" & @CRLF & _
"Miss. Nicola Carlin" & @CRLF & _
"Mr. Jason Kingsley" & @CRLF & _
"Mr Michael Sangster" & @CRLF & _
"Christopher Hill" & @CRLF & _
"Mrs. Balvinder Brar" & @CRLF & _
"Miss. Donna Walsh" & @CRLF & _
"Mark Armstrong" & @CRLF & _
"Miss. Ade Robinson Oshodi" & @CRLF & _
"owner occupier" & @CRLF & _
"Mr. CARE OF Lauristons" & @CRLF & _
"Owner Occupier" & @CRLF & _
"Mr. david Riley"
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