diff options
Diffstat (limited to 'tools/sploit/sploit/until.py')
-rw-r--r-- | tools/sploit/sploit/until.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/sploit/sploit/until.py b/tools/sploit/sploit/until.py new file mode 100644 index 0000000..b4f390f --- /dev/null +++ b/tools/sploit/sploit/until.py @@ -0,0 +1,14 @@ +from functools import partial as bind +import re + +def lastline(pred, /, *args, **kwargs): + s = args[-1] + args = args[:-1] + p = bind(pred, *args, **kwargs) + return p(s[-1]) + +def contains(regex, s): + return re.search(regex, s) + +def equals(regex, s): + return re.fullmatch(regex, s) |