擅长:python、mysql、java
<p>有一个功能:</p>
<pre><code>import re
fruit_list = ['raspberry', 'apple', 'strawberry']
def grep(yourlist, yourstring):
ide = [i for i, item in enumerate(yourlist) if re.search(yourstring, item)]
return ide
grep(fruit_list, "berry$")
</code></pre>