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
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.