Adds a filter to get callables whose names match any of the regex expressions from the given list. Returns a filtered child object. This method can be called on all child classes: and .
To filter given a single regex expression, refer to .
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
from glider import *
def query():
"""Retrieve the modifiers that:
- Start with `p` and end with `d`
- Start with `l` and end with `d`
"""
modifiers = Modifiers() \
.with_name_regexes([
r"^p.*d$",
r"^l.*d$"
]) \
.exec(100)
# Return the first five modifiers
return modifiers[:5]