Callables.with_name_regexes()
with_name_regexes(regexes: List[str]) โ Callables
Adds a filter to get callables whose names match any of the regex expressions from the given list. Returns a filtered Callables child object. This method can be called on all Callables child classes: Functions and Modifiers.
To filter given a single regex expression, refer to Callables.with_name_regex().
Functions Example
from glider import *
def query():
"""Retrieve the functions that:
- Start with `any` and end with a number
- Have `bbb` in their name but not `bbbb` or more consecutive b
"""
functions = Functions() \
.with_name_regexes([
r"^any.*\d$",
r"(?<!b)b{3}(?!b)"
]) \
.exec(100)
# Return the first five functions
return functions[:5]Output:

Modifiers Example
Output:

Last updated