python
Dashboard
My Repos
Compilers
Python Online
Node JS Online
Golang Online
codepy
Login
My Repos
Sign Out
Online Python Interpreter
Stop
Run
import re def filter_features(features, search): tokens = re.findall(r"['\"](.*?)['\"]", search) if search else [] if len(tokens) == 0 and search: tokens = search.split() def match_names(feature): return any(t in feature.name for t in tokens) if len(tokens): features = filter(match_names, features) return list(features) f = ["ok"] f = [{"name": fo} for fo in f] filter_features(f, "ok")
Share this code with others
Public
Clear
My Repos
Repo
Lang
Login
Register
Login
Create a free account. No Credit card info required.
I agree with the Codepy
Term of Service
Sign Up