Why all that backwhacking?
Something like /[]$#%>]\s*$/ will probably work in most cases. (I hate to even include a ']' in there but some people use it.) For /bin/sh, $ and # are by far the most common prompt endings, with or without following space.
-sauoq "My two cents aren't worth a dime.";
In reply to Re: Re: reg ex and the prompt
by sauoq
in thread reg ex and the prompt
by jcpunk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |