title: python re to match either underscore or hyphen in string
body: <p>Below is code:</p>
  
  <pre><code>import re
  a = "safe-Zoned-area"
  b = "Safe-zoned-Area"
  print(re.search(a, b, re.IGNORECASE))
  c = "safe_Zoned-area"
  d = "Safe-zoned-Area"
  print(re.search(c, d, re.IGNORECASE))
  </code></pre>
  
  <p>I am able to match case sensitive strings in my first print statement.</p>
  
  <p>user will provide input in above code,   Assume it is  variable d in above code example, </p>
  
  <p>sometime user enter safe_zoned-area. some users will enter Safe_Zoned_Area.</p>
  
  <p>The point here is we should match either user enter underscore or hyphen between safe and zoned and zoned and area. </p>
  
  <p>Note: These are the variables in pattern and text.</p>
  
  <p>d = defined by me
  c = get from user input </p>
  
  <p>Please help.   </p>