atom feed7 messages in org.freebsd.freebsd-questionsPerl question
FromSent OnAttachments
Christopher RuedOct 2, 2000 11:00 am 
Mark OvensOct 2, 2000 11:15 am 
Mark OvensOct 2, 2000 11:25 am 
Andresen,Jason R.Oct 2, 2000 11:36 am 
Christopher RuedOct 2, 2000 2:09 pm 
Mark OvensOct 2, 2000 3:34 pm 
Dirk MyersOct 2, 2000 7:21 pm 
Subject:Perl question
From:Christopher Rued (c.r@xsb.com)
Date:Oct 2, 2000 11:00:49 am
List:org.freebsd.freebsd-questions

I realize that this is not really a FreeBSD question, but I like this mailing list and the answers that are sent to it :).

My question is: How do I have perl return me the first and only the first match to a regular expression? I know that I can return /all/ matches to an array, and get the first one, but I only want to have it evaluate as far as the first match and then stop.

For example, given the string xayxbyxcy and the regular expression x.y, I want it to return to me only xay and not evaluate any further.

Thanks in advance.

To Unsubscribe: send mail to majo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message