The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
prompt generic
    match /[\/a-zA-Z0-9._-]+ ?(?:\(config[^)]*\))? ?[#>] ?$/

prompt basic
    match /> ?$/

prompt privileged
    match /# ?$/

prompt configure
    match /\(config[^)]*\)# ?$/

prompt user
    match /(?:[Ll]ogin|[Uu]sername)/

prompt pass
    match /[Pp]assword: ?$/

macro begin_privileged
    send enable
    match user or pass or privileged

macro end_privileged
    send disable
    match privileged

macro disconnect
    send exit
    match generic

# macro completion
#     send ?

# legacy support
prompt prompt
    match /[\/a-zA-Z0-9._-]+ ?(?:\(config[^)]*\))? ?[#>] ?$/