RE: Regular expression question

2006-08-01 Thread Joe Discenza
Title: Regular expression question Cai, Lucy (L.) wrote, on Monday, July 31, 2006 8:21 PM : 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"; May I suggest you use File:Basename instead of a regex? Joe

RE: 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: Regular expression question

2006-04-27 Thread Chris Wagner
At 09:45 PM 4/26/2006 -0400, Cai, Lucy \(L.\) wrote: >return (($Output =~ /.*\(ucmvob\)/s*$/) ? 1 : 0); >$Output ="/vobs/na_mscs_pvob >/ccstore/ecc/vobs_fcis321/na_mscs_pvob.vbs public (ucmvob,replicated)" > >What I want to do is if this tring include word "ucmvob", then return 1, >else re

Re: Regular expression question

2006-04-26 Thread Ted Schuerzinger
"Cai, Lucy (L.)" <[EMAIL PROTECTED]> graced perl with these words of wisdom: > return (($Output =~ /.*\(ucmvob\)/s*$/) ? 1 : 0); > > } > ** > > $Output ="/vobs/na_mscs_pvob > /ccstore/ecc/vobs_fcis321/na_mscs_pvob.vbs p

RE: Regular expression question

2006-04-26 Thread Timothy Johnson
Well, there are a couple of issues here. First off, I don't think this would even compile, because you used /s instead of \s. Secondly, your regex is looking for: .* zero or more of any character (unnecessary, since you didn't anchor the start

Re: regular expression question

2004-04-01 Thread Michael 'topdog' Thompson
Stacy Doss wrote: $a = "this is a (test)"; $a =~ s/\W+/_/g; HTH -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of [EMAIL PROTECTED] Sent: Thursday, April 01, 2004 11:28 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: regular _expression_ qu

RE: regular expression question

2004-04-01 Thread Peter Guzis
PROTECTED]; [EMAIL PROTECTED] Subject: RE: regular expression question Thanks for the replying. I have another question, if I have a string like $a = "this is a (test)"; How can I change it to $a = "this_is_a_test"; How can I remove ()? Thanks Lixin -Original Messa

RE: regular expression question

2004-04-01 Thread Stacy Doss
$a = "this is a (test)"; $a =~ s/\W+/_/g; HTH -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of [EMAIL PROTECTED] Sent: Thursday, April 01, 2004 11:28 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: regular expression question Than

RE: regular expression question

2004-04-01 Thread Cai_Lixin
$Bill Luebkert Sent: Wednesday, March 31, 2004 8:27 PM To: [EMAIL PROTECTED] Subject: Re: regular expression question Wagner, David --- Senior Programmer Analyst --- WGO wrote: Hey guys - what's with the HTML ? > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of > [

Re: regular expression question

2004-03-31 Thread $Bill Luebkert
Wagner, David --- Senior Programmer Analyst --- WGO wrote: Hey guys - what's with the HTML ? > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of > [EMAIL PROTECTED] > Sent: Wednesday, March 31, 2004 16:49 > To: [EMAIL PROTECTED] > Subject: regular expression question > > I have a $a

RE: regular expression question

2003-03-28 Thread Cai_Lixin
Thanks Lixin -Original Message- From: Todd Hayward [mailto:[EMAIL PROTECTED] Sent: Friday, March 28, 2003 12:26 PM To: [EMAIL PROTECTED] Subject: Re: regular expression question Borrowing from the previous example of: > open(fHandle, "myfile.txt|"); > while (defin

Re: regular expression question

2003-03-28 Thread viktoras
This works: open (INPUT ,"your_input.txt") || die "$!"; open (OUTPUT, "> your_output.txt") || die "$!"; while () { if (m/GENERIC_MULTILINE/) { $_="GENERATION 116 # Impossible dependency # Needed to prevent FC4700 to CX-series upgrades DEPEND Navisphere >2.0.0.0.0 DEPEND Navisphere <1.0.0.0.0 GEND

RE: regular expression question

2003-03-28 Thread Adam Frielink
> > I have another question, > > I have string like "> GENERATION 116", How can I get rid of ">", of the > string? If you want to remove the 1st character if it is a ">", then use this... $var =~ s/>//; $var =~ s/^>//; #This removes it only if it is the first character ___

RE: regular expression question

2003-03-28 Thread Gerber, Christopher J
3 11:58 AM > To: [EMAIL PROTECTED] > Subject: RE: regular expression question > > > I have another question, > > I have string like "> GENERATION 116", How can I get rid of > ">", of the > string? > > Thanks > > Lixin > >

RE: regular expression question

2003-03-28 Thread Cai_Lixin
I have another question, I have string like "> GENERATION 116", How can I get rid of ">", of the string? Thanks Lixin -Original Message- From: Todd Hayward [mailto:[EMAIL PROTECTED] Sent: Friday, March 28, 2003 11:30 AM To: [EMAIL PROTECTED]; [EMAIL PROTE

Re: regular expression question

2003-03-28 Thread thomas . baetzler
[EMAIL PROTECTED] schrieb: > I have a txt file like the bottom (I use cleardiff to > compare 2 files and > get this file): I would recommend that you look at Parse::RecDescent. Go grab the distribution from CPAN and have a look at the tutorial - the first example shows you how to parse a diff. h

RE: regular expression question

2002-11-23 Thread Carl Jolley
On Fri, 22 Nov 2002, Stovall, Adrian M. wrote: > > -Original Message- > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > > Sent: Friday, November 22, 2002 4:38 PM > > To: Stovall, Adrian M.; [EMAIL PROTECTED] > > Cc: [EMAIL PROTECTED] > > Subj

Re: regular expression question

2002-11-23 Thread Carl Jolley
On Fri, 22 Nov 2002 [EMAIL PROTECTED] wrote: > all, > > I want to check the first line of the file if it is machine or not, like > > The first line of the file is: > > Job "\nest and \toolbox VOBs" began execution on 9/6/02 at 2:00:11 AM. > > my code is like: > > if (!-z $file) > { > o

RE: regular expression question

2002-11-22 Thread Cai_Lixin
Yes, it works fine for me! Thanks a lot! Have a nice day. Lixin -Original Message- From: Stovall, Adrian M. [mailto:[EMAIL PROTECTED]] Sent: Friday, November 22, 2002 5:42 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: regular expression question > -Original Mess

RE: regular expression question

2002-11-22 Thread Stovall, Adrian M.
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Friday, November 22, 2002 4:38 PM > To: Stovall, Adrian M.; [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: RE: regular expression question > > > I tried that, it does

RE: regular expression question

2002-11-22 Thread Cai_Lixin
I tried that, it does not work for me! Lixin -Original Message- From: Stovall, Adrian M. [mailto:[EMAIL PROTECTED]] Sent: Friday, November 22, 2002 5:28 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: regular expression question Cai Lixin said: > > > all, >

RE: regular expression question

2002-11-22 Thread Stovall, Adrian M.
Cai Lixin said: > > > all, > > I want to check the first line of the file if it is machine > or not, like > > The first line of the file is: > > Job "\nest and \toolbox VOBs" began execution on 9/6/02 at 2:00:11 AM. > > my code is like: > > if (!-z $file) > { > open(LOG_FILE, "<

RE: regular expression question

2002-11-22 Thread Cai_Lixin
Sorry, I did not state quite clear, if it is machine or not, I want to say if I it is the right file or not... Lixin -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, November 22, 2002 5:07 PM Cc: [EMAIL PROTECTED] Subject: regular expression question a

Re: Regular Expression Question

2002-03-04 Thread Tim . Moose
Resending because I never saw the message post. Sorry if duplicate. Try this # my $text = "this is a website: www.hello-world.com and an e-mail: [EMAIL PROTECTED]"; @found = $text =~ m/\s+((?:[\w\d\-\~]{2,}[@|\.](?:[\w\d\-\~]{2,}\.?)+))/g; print "Fo

RE: Regular Expression Question

2002-03-04 Thread Joseph Youngquist
, Richard E. Sent: Monday, March 04, 2002 3:32 PM To: 'Joseph Youngquist'; [EMAIL PROTECTED] Subject: RE: Regular Expression Question I think that you may need to do this in a while loop: my @items while($text =~ m/your string here/g) { push @items, $1; } print join("\n&

RE: Regular Expression Question

2002-03-04 Thread Joseph Youngquist
tml. Thanks for the idea, I'll poke about with it...if no one sends a yes/no to the question above. Joe Y. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Jeffrey Sent: Monday, March 04, 2002 3:51 PM To: [EMAIL PROTECTED] Subject: RE: Regular Expression

Re: Regular Expression Question

2002-03-04 Thread Tim . Moose
Try this # my $text = "this is a website: www.hello-world.com and an e-mail: [EMAIL PROTECTED]"; @found = $text =~ m/\s+((?:[\w\d\-\~]{2,}[@|\.](?:[\w\d\-\~]{2,}\.?)+))/g; print "Found something interesting:\n", join "\n", @found if @found; # which uses t

Re: regular expression question

2001-06-01 Thread Rodney Wines
ctory name to be lib/, while dirname() considers the directory name to be . (dot). - Original Message - From: "Carl Campbell" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Friday, June 01, 2001 1:05 AM Subject: RE: regular expression

RE: regular expression question

2001-05-31 Thread Carl Campbell
Not really a regex approach but here is my submittion: $OK = "c:\\temp\\test\\test1\\test2"; $your_answer = substr($OK, 0, rindex($OK, "\\")); # print $your_answer,"\n"; -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 31,

Re: regular expression question

2001-05-31 Thread Ron
No regex in answer here but... Is this what you want? use File::Basename; $OK = "c:\\temp\\test\\test1\\test2"; $OK1 = dirname($OK); print "dir of $OK is $OK1\n"; - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, May 31, 2001 5:17 PM Subject

RE: regular expression question

2001-05-31 Thread Trever Furnish
$OK = "c:\\some\\dir\\file"; $OK =~ /(.*)(\\.*)$/; $OK1 = $1; ...of course it isn't portable across operating systems, and it assumes that filenames can't contain \. > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf Of > [EMAIL PROTECTED] > Sent: Thursd

Re: Regular Expression question

2001-03-02 Thread Ron Grabowski
> This works great, but now I need to add an (AND, OR) search ability to my > search. $query->{Find} =~ /^(.+?)\s+(and|or)\s+(.+?)$/i; $sql = "SELECT bla, bla FROM table WHERE column LIKE '$1' $2 '$3'" Of course you'll have to tweak that so a user doesn't enter something like and foo foo and

RE: Regular Expression question

2001-03-02 Thread Joseph P. Discenza
(un-jeopardied) Wagner-David wrote, on Friday, March 02, 2001 13:08 : steve silvers [mailto:[EMAIL PROTECTED]] wrote : > Say I search on (perl and oracle). : > : > if ($query->{Find} =~ /and/i) { : > Run my sql statement ie: perl and oracle : > } : > : > if ($query->{Find} =~ /or/i) { : >

Re: Regular Expression question

2000-11-21 Thread Jon Bjornstad
steve silvers wrote: > I'm calling a bunch of rows from my database. > In the while loop. > > while(my $Dataref = $sth->fetchrow_hashref) { >my %Data = %{$Dataref}; >my $text = ($Data{val}); > > $text = (/(www\.[\w\.\-\/\&\=\+\%\:\?]*[a-zA-Z\/0-9])[\001\074]*/) >

Re: Regular Expression question

2000-10-05 Thread Nikola Knezevic
> I am curious, why does this exact same question keep showing up, from > different people (I believe) and with a spaced regularity over and over > again? I don't know, but you are right. The most FAQ is : How to send attachments? The second place is reserved to: How to fetch rows? The third : Ho