title: How to find a string in each row in a dataframe in pyspark
body: <p>Here is the data frame available:</p>
  
  <pre><code>+--------------------+
  |                Name|
  +--------------------+
  |Braund, Mr. Owen ...|
  |Cumings, Mrs. Joh...|
  |Heikkinen, Miss. ...|
  |Futrelle, Mrs. Ja...|
  |Allen, Mr. Willia...|
  |Moran, Mr. James|
  |McCarthy, Mr. Tim...|
  |Palsson, Master. ...|
  |Johnson, Mrs. Osc...|
  +--------------------+
  </code></pre>
  
  <p>I want to find the first occurrence of Title and Surname in each row in DATA FRAME using Pyspark (Pandas lib is not available in my cluster).</p>
  
  <pre><code>pattern=re.compile(r'(Dr|Mrs?|Ms|Miss|Master|Rev|Capt|Mlle|Col|Major|Sir|Lady|Mme|Don)\\.'
  pattern.match(df['Name'])
  </code></pre>