Re: RegEx to extract last character of a line

2009-02-08 Thread Dr.Ruud
Greg wrote: I have an input file that I have to evaluate whether to include lines based upon their last character. Is there a simple regex that would allow me to assign the very last character to a variable? In my case it will either be A or I (capital i) if that helps? while ( <$fh_in> )

Re: RegEx to extract last character of a line

2009-02-07 Thread Chas. Owens
On Sat, Feb 7, 2009 at 07:10, John W. Krahn wrote: > Rob Dixon wrote: >> >> Greg wrote: >>> >>> I have an input file that I have to evaluate whether to include lines >>> based upon their last character. >>> Is there a simple regex that would allow me to >>> assign the very last character to a vari

Re: RegEx to extract last character of a line

2009-02-07 Thread John W. Krahn
Rob Dixon wrote: Greg wrote: I have an input file that I have to evaluate whether to include lines based upon their last character. Is there a simple regex that would allow me to assign the very last character to a variable? ^^^ ^^^

Re: RegEx to extract last character of a line

2009-02-07 Thread John W. Krahn
Greg wrote: I have an input file that I have to evaluate whether to include lines based upon their last character. Is there a simple regex that would allow me to assign the very last character to a variable? In my case it will either be A or I (capital i) if that helps? /([AI])\z/ and my $vari

Re: RegEx to extract last character of a line

2009-02-07 Thread Rob Dixon
Greg wrote: > > I have an input file that I have to evaluate whether to include lines > based upon their last character. > Is there a simple regex that would allow me to assign the very last > character to a variable? > > In my case it will either be A or I (capital i) if that helps? > > Thanks v

RegEx to extract last character of a line

2009-02-07 Thread Greg
I have an input file that I have to evaluate whether to include lines based upon their last character. Is there a simple regex that would allow me to assign the very last character to a variable? In my case it will either be A or I (capital i) if that helps? Thanks very much from a perl newb. -G