Re: difficulty with matching

2018-06-04 Thread Shlomi Fish
On Sat, 2 Jun 2018 07:30:48 -0500 p...@reason.net wrote: > Very useful advice, Shlomi; thanks! > you are welcome! Also see http://perl-begin.org/tutorials/bad-elements/ , which I also maintain. > > > On Jun 2, 2018, at 3:57 AM, Shlomi Fish wrote: > > > > On Fri, 1 Jun 2018 15:54:55 -0500 > >

Re: difficulty with matching

2018-06-03 Thread Mike Flannigan
ith it like this you can at least figure out what it is doing, but maybe not why.  The manpages will probably be needed to answer that. Please let us know what you find out. Mike On 6/1/2018 3:55 PM, beginners-digest-h...@perl.org wrote: Subject: difficulty with matching From: Rick T Date:

Re: difficulty with matching

2018-06-02 Thread perl
Very useful advice, Shlomi; thanks! > On Jun 2, 2018, at 3:57 AM, Shlomi Fish wrote: > > On Fri, 1 Jun 2018 15:54:55 -0500 > Rick T mailto:p...@reason.net>> wrote: > >> This is a newbie question, I’m sure. But I get perplexed easily! >> >> The follow code segment expects to receive a $student

Re: difficulty with matching

2018-06-02 Thread Shlomi Fish
On Fri, 1 Jun 2018 15:54:55 -0500 Rick T wrote: > This is a newbie question, I’m sure. But I get perplexed easily! > > The follow code segment expects to receive a $student_id consisting of a > surname followed by a hyphen followed by a number. The die is for testing > what I’m doing. > > If I

Re: difficulty with matching

2018-06-01 Thread Andy Bach
> If I feed it 'jones-123’ it dies with ‘jones, - , 123’ as I expected. But if I feed it ‘jones-‘ omitting the number on the end, it dies with no matches at all (or blanks): ‘ , , ‘ and I cannot figure out why it does not die with ‘jones, -, ' and would appreciate an explanation. Many thanks!

Re: difficulty with matching

2018-06-01 Thread Octavian Rasnita
[0-9]+ means at least one digit in range 0-9. If there is no digit, the string won't match. You want [0-9]* instead. --Octavian - Original Message - From: Rick T To: Perl Beginners Sent: Friday, June 01, 2018 11:54 PM Subject: difficulty with matching This is a n

difficulty with matching

2018-06-01 Thread Rick T
This is a newbie question, I’m sure. But I get perplexed easily! The follow code segment expects to receive a $student_id consisting of a surname followed by a hyphen followed by a number. The die is for testing what I’m doing. If I feed it 'jones-123’ it dies with ‘jones, - , 123’ as I expect