title: The correct way to identify a regular expression of the sort [variableName].add(
body: <p>I'm looking for a clean way to identify occurrences of [variableName] followed by the exact string <code>.add(</code>.</p>
  
  <p>A variable name is a string which contains one or more characters from a-z, A-Z, 0-9 and an underscore.</p>
  
  <p>One more thing is that it cannot start with any of the characters from 0-9, but I don't mind ignoring this condition because there are no such cases in the text that I need to parse anyway.</p>
  
  <p>I've been following several tutorials, but the farthest I got was finding all occurrences of what I've referred to above as "variableName":</p>
  
  <pre><code>import re
  
  txt = "The _rain() in+ Spain5"
  x = re.split("[^a-zA-Z0-9_]+", txt)
  print(x)
  </code></pre>
  
  <p>What is the right way to do it?</p>