Jim Canon wrote:
> 
> On 1/14/07, John W. Krahn <[EMAIL PROTECTED]> wrote:
>>
>> Jim Canon wrote:
>> >
>> > Thank you very much for the response, it has helped me begin to
>> > understand how regular expressions work.  I see that /(\d+)$/
>> > matches the numbers until the end of line in
>> >
>> > @job1 = qw(
>> >  job555
>> >  job572
>> >  job8433
>> >  job873
>> >  job594
>> >  job4663
>> >  job2221
>> >  job2223
>> > );
>> >
>> > [ snip]
>> >
>> > If I wanted to match the same as above, but there are other numbers
>> > infront of what I need to match, such as below:
>> >
>> > @job1 = qw(
>> > word1 word2 job2006 three four five six community job555
>> > word1 word2 job2006 three four five six community job8433
>> > word1 word2 job2006 three four five six community job873
>> > word1 word2 job2006 three four five six community job594
>> > word1 word2 job2006 three four five six community job4663
>> > word1 word2 job2006 three four five six community job2221
>> > word1 word2 job2006 three four five six community job2223
>> > );
>> >
>> > [ snip ]
>> >
>> > What would be the best expression you would use to match the same
>> > jobnumbers as previously?  I tried all of the expressions that made
>> > sense to me but did not have luck
>>
>> I do not understand your question.  In your example arrays above none of
>> the elements have "numbers infront" of them?
> 
> By numbers in front I am referring to word1 word2 job2006
> in the element:
> word1 word2 job2006 three four five six community job555

There are nine elements there, some of which have numbers at the *end*.

> It seems that /(\d+)$/ matches word1 word2 job2006 job555

Yes because each of those elements has a number at the end.

> I was reviewing http://perldoc.perl.org/perlre.html but am having trouble
> determining the best way to match just job555

???


John
-- 
Perl isn't a toolbox, but a small machine shop where you can special-order
certain sorts of tools at low cost and in short order.       -- Larry Wall

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to