|
|
| Come for the quick hacks, stay for the epiphanies. | |
| PerlMonks |
a really dumb regular expression questionby jcpunk (Friar) |
| on Jan 18, 2004 at 21:49 UTC ( [id://322262]=perlquestion: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.jcpunk has asked for the wisdom of the Perl Monks concerning the following question:
I do not understand regular expressions. That being said I have tried, but the "ah ha" moment when the syntax finally makes sense I still wait upon as I read tutorial after tutorial.
I've been working on a program to collect user data so that I can be lazy at work. I have to answer about 10 "Do you know where I forwared my mail to?" type questions and about 5 "Can you setup my account with a vacation message?" type questions per shift. It gets old fast; so I've got a script that will jump from server to server (using Net::SSH) looking at files and changing them depending on what I tell it to do. It works fine, but I have designs on making users use a non-root version from the web (Net::SSH::Perl so I can get their passwords and login as them) of it so they don't even have to ask me. That being said I need to clean up the output a bit. So I was wondering about a regular expression that could match the following output. $HOME and $library::common{username} are scalars (well kinda) that hold data. I do not need to match their names, but instead what they contain. I would much rather handle both of those cases in one regular expression then in two seperate if statements. The best i have turned up so far is and it does not work. Tips anyone? jcpunk all code is tested, and doesn't work so there :p (varient on common PM sig for my own ammusment)
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||