Re: [Perl-unix-users] Regular expression question

2006-08-01 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Title: Regular expression question From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Cai, Lucy (L.)Sent: Monday, July 31, 2006 17:21To: Cai, Lucy (L.); perl-win32-users@listserv.ActiveState.com; perl-unix-users@listserv.ActiveState.com; [EMAIL PROTECTED]; [EMAIL PROTECTED]Sub

Re: [Perl-unix-users] Regular expression question

2006-08-01 Thread Bertrand, Jean-Marc
Title: Regular expression question Try something like:       my ($dir , $filename) = $file= ~ /^(.*?)\\([^\\]*?)$/ ;   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of< /B>Cai, Lucy (L.)Sent: Monday, July 31, 2006 8:21 PMTo: Cai, Lucy (L.); perl-win32-users@listserv.ActiveSt

[Perl-unix-users] Regular expression question

2006-08-01 Thread Cai, Lucy \(L.\)
Title: Regular expression question I have a file such as: My $file = "c:\temp\zips\ok.txt"; How can I split the $file to get the only path: My $dir = "c:\temp\zips"; My $file = "ok.txt"; Thanks in advance! Lucy ___ Perl-Unix-Users mail

[Perl-unix-users] Regular expression question

2006-08-01 Thread Cai, Lucy \(L.\)
Title: Regular expression question I have a file such as: My $file = "c:\temp\zips\ok.txt"; How can I split the $file to get the only path: My $dir = "c:\temp\zips"; My $file = "ok.txt"; Thanks in advance! Lucy ___ Perl-Unix-Users ma

Re: [Perl-unix-users] regular expression question

2006-04-27 Thread DZ-Jay
On Apr 26, 2006, at 22:50, $Bill Luebkert wrote: or simpler if you just are interested in ucmvob being present: return $Output =~ /ucmvob/ ? 1 : 0; Or to make sure that it is not a substring within another "word": return $Output =~ /\bucmvo\b/ ? 1 : 0; The "\b" will match at

Re: [Perl-unix-users] regular expression question

2006-04-26 Thread $Bill Luebkert
Cai, Lucy (L.) wrote: > Hi, all, > > I have a question about regular expression: > > my code is like this: > ** > sub IsPVob > { > my ($Vob) = @_; > > my $Output = `cleartool lsvob $Vob`; > die "IsPVob

[Perl-unix-users] regular expression question

2006-04-26 Thread Cai, Lucy \(L.\)
Title: Counting words Hi, all,   I have a question about regular _expression_:   my code is like this: ** sub IsPVob{    my ($Vob) = @_;       my $Output = `cleartool lsvob $Vob`;    die "IsPVob can't list vob $

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) {   

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-03 Thread Anthony Ettinger
On 3/2/06, Jason Vincent <[EMAIL PROTECTED]> 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

[Perl-unix-users] Regular Expression Question

2006-03-03 Thread Jason Vincent
Title: Regular Expression Question 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 =