in reply to Re: Re: checking the end of line
in thread checking the end of line
Do I?
For a string 'stuff_here_then_12' your version captures the 1. It depends if that's what the user wants. Of course there's probably a better way to do this /(\d)\d*$/ comes to mind (and /(\d)+$/ if the user wants the last digit, or even better /(\d)$/ .. updated .. well, if just the last digit is desired and it's always known to be a digit substr could be used more effeciently -- of course, you have to be sure of your data)
I was under the impressino that he wanted the entire 12 returned.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: Re: checking the end of line
by I0 (Priest) on Jul 19, 2002 at 23:35 UTC | |
by dimmesdale (Friar) on Jul 20, 2002 at 14:04 UTC | |
by I0 (Priest) on Jul 20, 2002 at 17:17 UTC | |
by dimmesdale (Friar) on Jul 20, 2002 at 19:45 UTC | |
by I0 (Priest) on Jul 20, 2002 at 22:13 UTC |
In Section
Seekers of Perl Wisdom