sshで接続するターミナルからの特定のタイプのプロンプトを処理するドライバーを作成しています。
The code in the driver is looking for a particular pattern received from the device to know when to send additional commands or exit, etc.
The code in the driver takes the pattern as a regular expression. I've tried numerous different combinations of patterns for the regex to handle this prompt '(Cisco Controller) >'
, but to no avail. I've tried to escape the parenthesis '\(Cisco Controller\)\s*>'
, I've tried with raw string
r'\(Cisco Controller\)\s*>'
, and I've tried multiple other combinations, but I usually end up with the error "Unbalanced Parenthesis" or "Bogus escape character". Why can't I get the regex engine to accept this pattern?