title: Apache Spark: how to transform Data Frame column with regex to another Data Frame?
body: <p>I have Spark Data Frame 1 of several columns: (user_uuid, url, date_visit)</p>
  
  <p>I want to transform this DF1 to Data Frame 2 with form : (user_uuid, domain, date_visit)</p>
  
  <p>What I wanted to use is regular expression to detect domain and apply it to DF1  <code>val regexpr = """(?i)^((https?):\/\/)?((www|www1)\.)?([\w-\.]+)""".r</code></p>
  
  <p>Could you please help me composing code to transform Data Frames in Scala? I am completely new to Spark and Scala and syntax is hard. Thanks!</p>