title: Search for exact match in string based on values in array
body: <p>I am trying to search for items in an array using a free text string.  I have got so far, see code below, but I'm still returning results which only partially match.</p>
  
  <pre><code>var townArray = ["Leamington Spa", "Birmingham", "Coventry", "Leamington Hastings", "Royal Leamington Spa", "Lea", "Leam", "Cove"]
  
  let searchText = "Anyone want to meet in Leamington Spa or Coventry"
  
  var resultsArray = [String]()
  
  for i in townArray {
      let range = searchText.lowercased().range(of: i.lowercased(), options: .regularExpression)
      // (8 times)
      if range != nil {
      let found = searchText.substring(with: range!)
      print(found)
      resultsArray.append(found)
      // (5 times)}
  }
  print(resultsArray)
  // ["Leamington Spa", "Coventry", "Lea", "Leam", "Cove"]
  </code></pre>