title: Firebase App Search Feature - Query Using String Regex
body: <p>I am porting an app over from Parse to Firebase and I used to be able to query using <code>matchesRegex</code> and putting the search into <code>"(?i)\(searchBar.text!)"</code>. By doing this, the user could search "p" and the database would return (for example) "person", "People", "pot", etc.</p>
  
  <p>I can't seem to find a way to query like this using Firebase that allows a user to search part of a String and Firebase looks for the substring within the database.</p>
  
  <p>I am using:</p>
  
  <pre><code>databaseReference.child("Schools").queryOrderedByKey().queryEqualToValue("(?i)\(searchBar.text!)").observeSingleEventOfType(.Value, withBlock: { (snapshot) in
  
      for childSnapshot in snapshot.children {
  
          print("SANP \(childSnapshot)")
  
      }
  
      }) { (error) in
  
          print(error)
  
      }
  </code></pre>
  
  <p>If I do this, nothing is printed. I know the code above works if I search for a specific value that is character-for-character the same as it is in the database.</p>
  
  <p><strong>How can I search using parts of a String within the Firebase database?</strong></p>