title: spark regex while join data frame
body: <p>I need to write some regex for condition check in spark while doing some join,</p>
  
  <p>My regex should match below string </p>
  
  <pre><code>n3_testindia1 = test-india-1
  n2_stagamerica2 = stag-america-2
  n1_prodeurope2 = prod-europe-2
  </code></pre>
  
  <p>df1.select("location1").distinct.show()</p>
  
  <pre><code>+----------------+
  |    location1   |
  +----------------+
  |n3_testindia1   |
  |n2_stagamerica2 |
  |n1_prodeurope2  |
  </code></pre>
  
  <p>df2.select("loc1").distinct.show()</p>
  
  <pre><code>+--------------+
  |      loc1    |
  +--------------+
  |test-india-1  |   
  |stag-america-2|
  |prod-europe-2 |
  +--------------+
  </code></pre>
  
  <p>I want to join based on location columns like below </p>
  
  <pre><code>val joindf = df1.join(df2, df1("location1") == regex(df2("loc1")))
  </code></pre>