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
> >
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:
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
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
> 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!
[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
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