Re: regex for EOF

Paolo <[email protected]>
Newsgroups gmane.mail.spam.crm114
Message-ID <20090318131411.GE13905@localhost>
On Wed, Mar 18, 2009 at 01:37:35PM +0100, Thomas Michael Hagen wrote:
> is there a regex that will match end-of-file?

the '$' will match 'end-of-string', which means EOF unless you use 
<nomultiline> flag, eg:

$ printf '123\n456\n7890\n' |\
$	crm '-{match (:: :x:) /(...)$/; output /-:*:x:-\n/}'
-90
-

note that '.' matched last \n before EOF.

$ printf '123\n456\n7890\n' |\
$	crm '-{match <nomultiline> (:: :x:) /(...)$/; output /-:*:x:-\n/}'
-123-




HTH
-- 
paolo

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
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.