title: pyspark extracting a string using python
body: <p>Spark dataframe which has column <code>emailID</code>  : <code>ram.shyam.78uy@testing.com</code>. i would like to extract the string between &quot;.&quot; and &quot;@&quot;  i.e <code>78uy</code> and store it in column.
  tried</p>
  <pre><code>split_for_alias = split(rs_csv['emailID'],'[.]') 
  rs_csv_alias= rs_csv.withColumn('alias',split_for_alias.getItem(size(split_for_alias) -2)) 
  </code></pre>
  <p>Its adding <code>78uy@testing</code> as alias. Another column can be added and chop off the extra values. But is it possible to do in single statement.</p>