Python/SPSS: pattern in names not consecutive
<p>Starting to use SPSS/Python, I need to average variables whose names contain two different strings. I found many examples for individual strings (or numbers, etc.), but my strings are not adjacent.</p>

<p>var1_blabla_def_blabla_jkl</p>

<p>var2_blabla_blabla_def_jkl</p>

<p>var3_blabla_jkl_blabla_blabla</p>

<p>How do I get the mean over var1 and var2, containing "def" AND "jkl", and not var3 that contains only jkl? I am not sure what the regular expression would be for this pattern and how then to feed this into something like spss.Submit('compute %s=mean(%s))</p>

<p>Many thanks for any help and hints, I appreciate it.</p>