擅长:python、mysql、java
<p>您可以在<code>(?<![A-Za-z0-9])wordIWant\w*</code>上执行regex搜索,使用右侧的<code>\w*</code>来允许可能更长的单词:</p>
<pre><code>inp = "8963252A|HelloiAm25YearsOld__wordIWant3|someotherstuff|0"
matches = re.findall(r'(?<![A-Za-z0-9])wordIWant\w*', inp)
print(matches)
['wordIWant3']
</code></pre>