Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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

In reply to This looks like someone sneezed and hit the keyboard by Anonymous Monk

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2024-06-22 08:34 GMT
Find Nodes?
    Voting Booth?

    No recent polls found

    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.