jquast / telnetlib3

Python Telnet server and client Protocol library using asyncio
Other
147 stars 32 forks source link

Support for regular expressions in readuntil when the expected output is not known beforehand #88

Open rutgerhendriks opened 2 months ago

rutgerhendriks commented 2 months ago

Background: I was using the (now deprecated) telnetlib and just moved over to telnetlib3.

Comparing telnetlib with telnetlib3, I see that the function "expect" has been removed and replaced with readuntil. Unfortunately readuntil does not support regular expressions which makes it difficult to use telnetlib3 when you can't exactly predict the return text that you will receive. Is there an option that regular expressions can be added to e.g. readuntil or to a new function?