Re: Print ranges without its BEGIN and END patterns

"[email protected] [sed-users]" <[email protected]>
Newsgroups gmane.editors.sed.user
Message-ID <[email protected]>

   > perl -ne '$s=/^sec/../^fou/; print if $s>1 and $s!~/E/' 
 

 We can also use -ve lookbehind to skip the begin/end patterns, like as,
          perl -lne 'print if (/^sec/../^fou/) =~ /^\d+(?<!^1)$/' yourfile

 

 --Rakehs


[Non-text portions of this message have been removed]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.