develooper Front page | perl.beginners | Postings from September 2009

matching multi occurrences or nothing

Thread Next
From:
Noah Garrett Wallach
Date:
September 17, 2009 13:24
Subject:
matching multi occurrences or nothing
Message ID:
4AB29AC9.2020202@enabled.com
Hi there Perl folks,


Okay I am trying to figure this out.

I am trying to match the following:


$line = "blah&blah&blah"


so I have the following line to match that

$line =~ /((?:blah).*?){0,5}/;
But I want to capture "blah" in a variable like
$capture = $1;

or something like that?

am I on the right track?

Cheers,

Noah

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About