http://www.perlmonks.org?node_id=326134

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I'm new to perl and have to update a former employees code adding some support for more things matching a 'regular expression'
The expression is
/.*([\$#\%>~]|\@\w~\$|\\\[\\e\[0m\\\] \[0m)\s?/
and try as I might, all I can figure out is that this is a totally random string of letters symbols and slashes.

So I was wondering how support could be added to maintain current functionality (I'm not entirely sure what the current purpose of this is other then to check a login prompt which I got from the code and from my assignment to make it support a wider range of prompts) and at the same time support a string like hostname# or # also hostname% or % and hostname$ or $ as well as having user@hostname for all those characters or possibly those varried outputs surrounded by [ ]. I know I dont know how to do this type of thing, but I'm not sure how hard it might be for people who have been doing this a long time. After searching through the wealth of information out there I think I will need to work with perl for a bit longer before I will be able to make any sense of this sub-language it has within it.

Thanks a bunch
Jack