def select_regex_in(pl,regex):
def cond_func(ele,index,regex):<EOL><INDENT>if(type(ele)==type([])):<EOL><INDENT>cond = regex_in(ele,regex)<EOL><DEDENT>else:<EOL><INDENT>m = regex.search(ele)<EOL>if(m == None):<EOL><INDENT>cond = False<EOL><DEDENT>else:<EOL><INDENT>cond = True<EOL><DEDENT><DEDENT>return(cond)<EOL><DEDENT>arr = cond_select_values_all2(pl,cond_func=cond_func, cond_func_args =[regex])<EOL>return(arr)<EOL>
regex = re.compile("^x.*x$")
pl = ['bcd','xabcxx','xx','y']
select_regex_in(pl,'abc')