floobit has asked for the wisdom of the Perl Monks concerning the following question:
This question has probably been posted before, but I have spent about 2 hours looking through the doc and searching this forum and found nothing. I apologize:
In linux, I am trying to strip the tty off a ps aux. Here is the regular expression I would use in sed. It works wonderfully:
s!.*pts/\([0-9][0-9]*\).*!\1!When used in perl, it does not work. I have narrowed it down to the use of \( and \). When I remove these, the regex actually does something. How do I use the buffer functionality of sed in perl? Does anyone know a good online reference explaining the differences of perl's sed and canonical sed?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: using sed buffers
by ww (Archbishop) on May 02, 2012 at 21:37 UTC | |
by JavaFan (Canon) on May 02, 2012 at 22:39 UTC | |
by floobit (Initiate) on May 02, 2012 at 21:41 UTC | |
by ww (Archbishop) on May 02, 2012 at 21:48 UTC | |
by JavaFan (Canon) on May 02, 2012 at 22:46 UTC | |
Re: using sed buffers
by sauoq (Abbot) on May 02, 2012 at 21:41 UTC | |
by JavaFan (Canon) on May 02, 2012 at 22:48 UTC | |
by sauoq (Abbot) on May 03, 2012 at 00:12 UTC | |
by floobit (Initiate) on May 02, 2012 at 21:46 UTC | |
by sauoq (Abbot) on May 02, 2012 at 21:50 UTC | |
Re: using sed buffers
by Anonymous Monk on May 03, 2012 at 05:12 UTC | |
by floobit (Initiate) on May 03, 2012 at 12:58 UTC |
Back to
Seekers of Perl Wisdom