[clug-talk] Perl regular expressions ?

Michael Gale michael.gale at bluesuperman.com
Mon Mar 21 17:22:02 PST 2005


Hello,

I am going to start playing around with perl regular expressions but 
first have some questions I am hoping someone on the list can answer ?

1. Can I test them from the command line ?

echo "some string of text" | perl place_regular_expression_here

2. How would I go about producing arguments are out put, for example:

echo "Memory Usage: 25% used warning 75%" | perl 'Memory.Usage:.\d+'

The about would produce "Memory Usage: 25" but I only want to output the 
25 but I also need to make sure that the first part contains "Memory 
Usage:" ?

Thanks.

Michael.



More information about the clug-talk mailing list