Re: [Perl-unix-users] Regular Expression Question

2006-03-04 Thread $Bill Luebkert
Jason Vincent wrote: > > If I have a pattern that appears mulitple times (but I don't know how > many times) in a string, how do I get at the matched text for each of > the matches? > > Made up example… > > $string = 'ab23cdefgXX(3A5)XXhijkl23mnXX(3)XXopq432rsXX(450b)XXtuv'; > > If ($string =~

RE: [Perl-unix-users] Regular Expression Question

2006-03-04 Thread Sandeep Deshpande
Title: Regular Expression Question I hope something like this would help. You can store values in array and then use the array for any other operations.   my @values; $string = 'ab23cdefgXX(3A5)XXhijkl23mnXX(3)XXopq432rsXX(450b)XXtuv'; while ($string =~ /XX(\(\w+\))XX/gi) {