mirror of
https://github.com/gregtwallace/apc-p15-tool.git
synced 2025-01-22 08:14:08 +00:00
ssh: fix shell regex
* from ssh videos I found on youtube, the @ symbol might not be present in prompt, so make it optional * fix typo of 0-0 instead of 0-9 (all numbers are possible in the prompt)
This commit is contained in:
parent
7bf70c4d71
commit
208827f636
1 changed files with 2 additions and 2 deletions
|
@ -11,8 +11,8 @@ func scanAPCShell(data []byte, atEOF bool) (advance int, token []byte, err error
|
|||
return 0, nil, nil
|
||||
}
|
||||
|
||||
// regex for shell prompt (e.g., `apc@apc>`)
|
||||
re := regexp.MustCompile(`(\r\n|\r|\n)[A-Za-z0-0.]+@[A-Za-z0-0.]+>`)
|
||||
// regex for shell prompt (e.g., `apc@apc>`, `apc>`, `some@dev>`, `other123>`, etc.)
|
||||
re := regexp.MustCompile(`(\r\n|\r|\n)([A-Za-z0-9.]+@?)?[A-Za-z0-9.]+>`)
|
||||
|
||||
// find match for prompt
|
||||
if index := re.FindStringIndex(string(data)); index != nil {
|
||||
|
|
Loading…
Reference in a new issue