in reply to reg ex and the prompt

The regex you need depends on the prompt. The following expression should however work in most cases:

$prompt =~ /[$%#>] $/;

Michele.