Re: regular expression, this but not that

2011-09-18 Thread Gabor Szabo
On Mon, Sep 19, 2011 at 7:38 AM, Jer A wrote: > All, > > lets say i want to test if a string contains "pig" but not "dog" and/or not > "cat" > > i tried something like this: > >  =~ m/[^dog]|[^cat]|pig/ig > > what is the best way of going about this, using one regex? > > your help is very much app

Re: regular expression, this but not that

2011-09-18 Thread Glenn Linderman
On 9/18/2011 9:38 PM, Jer A wrote: All, lets say i want to test if a string contains "pig" but not "dog" and/or not "cat" i tried something like this: =~ m/[^dog]|[^cat]|pig/ig what is the best way of going about this, using one regex? your help is very much appreciated, perhaps the fol

regular expression, this but not that

2011-09-18 Thread Jer A
All, lets say i want to test if a string contains "pig" but not "dog" and/or not "cat" i tried something like this: =~ m/[^dog]|[^cat]|pig/ig what is the best way of going about this, using one regex? your help is very much appreciated, thanks. -Jeremy

RE: Regular expression with variable

2006-11-11 Thread Jerry Kassebaum
>I have a regular expression problem > >how do i use scalar variables in substitution and complex matching? > >eg I want the following to work. > >$string =~ s/^$variable//; > >$string =~ m/^([^$variable]*)/; > > >thanks in advance for your help. > >-Jerem

RES: Regular expression question

2006-08-01 Thread Fabricio Soares Martins - Site CBN - SGR
Title: Regular expression question hi wagner,   try this:   #/perl -w   $file = 'c:\temp\zips\foo\foo2\foo3\ok.txt'; @pa = split (/\\/, $file);$file = $pa[$#pa];    for $i (0..($#pa-1)) {  $dir .= "$pa[$i]\\"; }   print "directory: $dir\n";print &

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:Ba

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

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 __

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 __

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
Lucy (L.) Sent: Wednesday, April 26, 2006 6:46 PM To: perl-win32-users@listserv.ActiveState.com Cc: perl-win32-users@listserv.ActiveState.com Subject: Regular expression question Hi, all, I have a question about regular expression: my code is like this: ***

Regular expression question

2006-04-26 Thread Cai, Lucy \(L.\)
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: Regular Expression

2005-11-29 Thread Foo Ji-Haw
$String = 'Integration Test Lead: \ul\b0 \tab\tab\tab Kimberly Kim\tab\tab\tab\tab\tab\tab \par'; How would I extract "Kimberly Kim" from the string using regular expression. Is there a way using expression to skip "\[characters]" ( like \tab ) and search for

Re: Regular Expression

2005-11-28 Thread Chris Wagner
At 05:40 PM 11/28/2005 -0800, Wong, Danny H. wrote: >$String = 'Integration Test Lead: \ul\b0 \tab\tab\tab Kimberly >Kim\tab\tab\tab\tab\tab\tab \par'; > >How would I extract "Kimberly Kim" from the string using regular >expression. Is there a way using express

Regular Expression

2005-11-28 Thread Wong, Danny H.
Hi, I'm trying to figure out how to parse a string with special characters. $String = 'Integration Test Lead: \ul\b0 \tab\tab\tab Kimberly Kim\tab\tab\tab\tab\tab\tab \par'; How would I extract "Kimberly Kim" from the string using regular expression. Is there

Re: A regular expression question -- Emergency

2005-09-30 Thread Richard A. Wells
$Bill Luebkert wrote: Richard A. Wells wrote: [...] The _expression_ $path_elem =~ s{(\s)}{\\$1}gio; The /io is not needed/wanted. Right about the /i. That's conventional laziness on my part, as it is usually what I want, though it would be detrimental in this

Re: A regular expression question -- Emergency

2005-09-30 Thread $Bill Luebkert
Richard A. Wells wrote: > $Bill Luebkert wrote: >> Richard A. Wells wrote: >> >>> [...] >>> >>> The expression >>> >>> $path_elem =~ s{(\s)}{\\$1}gio; >>> >> >> The /io is not needed/wanted. >> > Right about the /i. That's conventional laziness on my part, as it is > usually what I w

Re: A regular expression question -- Emergency

2005-09-30 Thread $Bill Luebkert
\\ is necessary in the > substituion value, since \ itself is a metacharacter in a regex. I think it's easier to read this: my $win32 = $^O =~ /Win32/i; my $path_elem = $ENV{CLEARCASE_PN}; $path_elem =~ s/ /\ /g if not $win32; PS: Top-posting is something we try to avoid in these lists. >

Re: A regular expression question -- Emergency

2005-09-30 Thread Richard A. Wells
meeting a problem on a regular expression. My code is like: $path_elem = "$ENV{'CLEARCASE_PN'}"; The return value of $path_elem is either $path_elem = /ccstore/test/test.pl Or $path_elem = /ccstore/test 1/test 1.pl # there is a space in the path name including the file n

Re: A regular expression question -- Emergency

2005-09-30 Thread Richard A. Wells
problem on a regular expression. My code is like: $path_elem = "$ENV{'CLEARCASE_PN'}"; The return value of $path_elem is either $path_elem = /ccstore/test/test.pl Or $path_elem = /ccstore/test 1/test 1.pl # there is a space in the path name including the file name too Ther

A regular expression question -- Emergency

2005-09-30 Thread Cai, Lucy \(L.\)
Hi All, I am meeting a problem on a regular expression. My code is like: $path_elem = "$ENV{'CLEARCASE_PN'}"; The return value of $path_elem is either $path_elem = /ccstore/test/test.pl Or $path_elem = /ccstore/test 1/test 1.pl # there is a space in the path name inc

Re: Regular expression

2005-09-15 Thread $Bill Luebkert
$Bill Luebkert wrote: > You can also use quotemeta (look it up) or escape your .'s in $number (ie: > "1\.2\.3\.4"). That should have been '1\.2\.3\.4' or "1\\.2\\.3\\.4". -- ,-/- __ _ _ $Bill LuebkertMailto:[EMAIL PROTECTED] (_/ / )// // DBE CollectiblesM

Re: Regular expression

2005-09-15 Thread $Bill Luebkert
Wong, Danny H. wrote: > Hi Perl Gurus, > I have a regular expression question. > I have a variable > $Number = "1.2.3.4" > > When I use the variable $Number as part of my regular expression, the > "." character gets interpret as any character.

Re: Regular expression

2005-09-15 Thread Сергей Черниенко
Hello Danny, Thursday, September 15, 2005, 9:28:44 AM, You wrote: WDH> $Number = "1.2.3.4" WDH> When I use the variable $Number as part of my regular expression, the WDH> "." character gets interpret as any character. How do I make it a WDH> literal ".&qu

Re: Regular expression

2005-09-15 Thread Foo Ji-Haw
-users" Sent: Thursday, September 15, 2005 2:28 PM Subject: Regular expression > Hi Perl Gurus, > I have a regular expression question. > I have a variable > $Number = "1.2.3.4" > > When I use the variable $Number as part of my regular expression, the > ".&q

Regular expression

2005-09-14 Thread Wong, Danny H.
Hi Perl Gurus, I have a regular expression question. I have a variable $Number = "1.2.3.4" When I use the variable $Number as part of my regular expression, the "." character gets interpret as any character. How do I make it a literal "." that I'm search

Re: Perl Regular Expression Problem

2005-08-23 Thread $Bill Luebkert
[EMAIL PROTECTED] wrote: > Perl Regular Expression Problem > > We are having a problem with Perl's evaluation of regular expressions. > > Here is a code snippet: > > # This regular expression is looking for a word ending in "s" followed ># by somet

Re: Perl Regular Expression Problem

2005-08-23 Thread Chris Wagner
/www.ActiveState.com ActiveState is a division of Sophos. Built Dec 13 2004 09:52:01 At 03:38 PM 8/23/05 -0600, [EMAIL PROTECTED] wrote: >Here is the problem. >The $method variable contains 'Modules("M6833x LA")' and after >evaluating the regular expression, $1 contains

Perl Regular Expression Problem

2005-08-23 Thread paul_schwotzer
Perl Regular Expression Problem We are having a problem with Perl's evaluation of regular expressions. Here is a code snippet: # This regular expression is looking for a word ending in "s" followed # by something in parentheses # If the while-block is entered, $1 sho

RE: Regular Expression Help Please

2005-02-08 Thread Chris
-Original Message- One of the columns I'm calling out of my database is the email one. I'ts in MAPI format, so I need to extract the very last part. So the bottom example I would need to grab JDoe MAPI:{Doe, John}EX:/o=Company/ou=Site/cn=Recipients/cn=JDoe Then I can append the res

Re: Regular Expression Help Please

2005-02-08 Thread Chris Wagner
You can get that plus some other info with this regex: $string = 'MAPI:{Doe, John}EX:/o=Company/ou=Site/cn=Recipients/cn=JDoe'; ($lastname, $firstname, $mailid) = $string =~ m/^.+?\{(\w+), (\w+)\}.+?cn\=(\w+)$/; At 09:46 PM 2/8/05 +, steve silvers wrote: >One of the columns I'm calling out o

RE: Regular Expression Help Please

2005-02-08 Thread Charles K. Clarkson
From: [EMAIL PROTECTED] <> wrote: : One of the columns I'm calling out of my database is the email : one. I'ts in MAPI format, so I need to extract the very last : part. So the bottom example I would need to grab : : JDoe : : MAPI:{Doe, John}EX:/o=Company/ou=Site/cn=Recipients/cn=JDoe : : : Th

RE: Regular Expression Help Please

2005-02-08 Thread Gerber, Christopher J
-Original Message- > One of the columns I'm calling out of my database is the email one. I'ts in MAPI format, > so I need to extract the very last part. So the bottom example I would need to grab > > JDoe > > MAPI:{Doe, John}EX:/o=Company/ou=Site/cn=Recipients/cn=JDoe Steve, An easy way

Regular Expression Help Please

2005-02-08 Thread steve silvers
One of the columns I'm calling out of my database is the email one. I'ts in MAPI format, so I need to extract the very last part. So the bottom example I would need to grab JDoe MAPI:{Doe, John}EX:/o=Company/ou=Site/cn=Recipients/cn=JDoe Then I can append the rest as [EMAIL PROTECTED] Every one

Re: A regular expression question

2004-11-12 Thread Ted Schuerzinger
$Bill Luebkert graced perl with these words of wisdom: >>>B. I want to get 1.62 from the string, how can I do it? >> >> >> Nobody seems to have answered part B. > > Actually they did. Sam's for one : > > $string = "sct-1.62-1"; > print "$1\n" if ($string =~ /^.+-(.+)-.+$/); You mean $1 capt

Re: A regular expression question

2004-11-11 Thread $Bill Luebkert
Ted Schuerzinger wrote: > Cai, Lixin (L.) graced perl with these words of wisdom: > > >>My $string = "sct-1.62-1"; >> >>I have 2 regular expression question here, >> >>A. I want to check whether the format is "XXX-XXX-XXX", how can I d

Re: A regular expression question

2004-11-11 Thread Ted Schuerzinger
Cai, Lixin (L.) graced perl with these words of wisdom: > My $string = "sct-1.62-1"; > > I have 2 regular expression question here, > > A. I want to check whether the format is "XXX-XXX-XXX", how can I do it? > B. I want to get 1.62 from the string,

RE: A regular expression question

2004-11-11 Thread Gardner, Sam
Title: Message or even. . .   $string = "sct-1.62-1";print "$1\n" if ($string =~ /^.+-(.+)-.+$/);   (no need to use the backslash escape for the dashes; they're not part of a character class. . .     Sam Gardner GTO Application Development

RE: A regular expression question

2004-11-11 Thread Peter Eisengrein
Title: A regular expression question Your format does not match XXX-XXX-XXX so I'll guess you mean three fields delimited by a dash.   here's one way to do it   $string = "sct-1.62-1"; print "$1\n" if ($string =~ /^.+\-(.+)\-.+$/)           -Origina

A regular expression question

2004-11-11 Thread Cai, Lixin \(L.\)
Title: A regular expression question  Now I have a string like My $string = "sct-1.62-1"; I have 2 regular _expression_ question here, A. I want to check whether the format is "XXX-XXX-XXX", how can I do it? B. I want to get 1.62 from the string, how can I do i

RE: question of regular expression

2004-10-28 Thread Ed Chester
i wrote, obviously with my eyes closed: > s/-x/''/; which of course should be s/-x//; - sorry! ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: question of regular expression

2004-10-28 Thread Ed Chester
> Could anyone let me know by using regular expression, how can I get rid of "-x"? If that's all you really want, and you know that's the only place it can occur, then its no problem to use just s/-x/''/; (substitute '-x' by '') ed c _

question of regular expression

2004-10-28 Thread Ella Cai
I have one line like this:   $command = '$ldapsearch -x -LLL -h "cds2.ford.com" -b "ou=People, o=Ford,c=US" "uid=$login" uid fordUNIXid';   If { $command = '$ldapsearch -LLL -h "cds2.ford.com" -b "ou=People, o=Ford,c=US" "uid=$login" uid fordUNIXid'  # which -x need to remove }   Could anyone let

Re: LWP and Regular Expression

2004-05-07 Thread $Bill Luebkert
steve silvers wrote: > I'm using LWP::UserAgent to grab data from internal intranet site pages. I > can grab the page just fine with: > > $ua = LWP::UserAgent->new; > $ua->proxy(['http', 'ftp'] => 'http://login:[EMAIL PROTECTED]'); > > $req = HTTP::Request->new('GET',"http://google.com";); > >

LWP and Regular Expression

2004-05-07 Thread steve silvers
I'm using LWP::UserAgent to grab data from internal intranet site pages. I can grab the page just fine with: $ua = LWP::UserAgent->new; $ua->proxy(['http', 'ftp'] => 'http://login:[EMAIL PROTECTED]'); $req = HTTP::Request->new('GET',"http://google.com";); $res = $ua->request($req); print $res->c

RE: Regular expression to test for numeric values

2004-04-02 Thread Beckett Richard-qswi266
> So I get: > > /^-?(?:\d+\.?\d*|\.\d+)$/ I'm being thrown by the ?: What's that all about? R. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: Regular expression to test for numeric values

2004-04-01 Thread Dial Joe
" By Tom Christiansen, Nathan Torkington 2nd Edition August 2003 ISBN: 0-596-00313-7 964 pages, $49.95 US, $77.95 CA, £35.50 UK -Original Message- From: Motter, Jeffrey D [mailto:[EMAIL PROTECTED] Sent: Thursday, April 01, 2004 1:40 PM To: Perl-Win32-Users Subject: Regular expression to t

RE: Regular expression to test for numeric values

2004-04-01 Thread Peter Eisengrein
Title: RE: Regular expression to test for numeric values use Scalar::Util; if (Scalar::Util::looks_like_number $num) {     print "Yes, $num is a number\n"; } else {     print "no.\n"; } ... found it with perldoc -q number, which also showed a number of rege

RE: Regular expression to test for numeric values

2004-04-01 Thread Joseph Discenza
Gerber, Christopher J wrote, on Thursday, April 01, 2004 2:12 PM : -Original Message- : My guess is that I need a regex that will match on any character that is: : not 0-9 : or : more than one "." : or : more than one "-" : or if "-" is not the fir

RE: Regular expression to test for numeric values

2004-04-01 Thread Gerber, Christopher J
-Original Message- My guess is that I need a regex that will match on any character that is: not 0-9 or more than one "." or more than one "-" or if "-" is not the first character of the string Any ideas? Is it possible to do without usi

RE: Regular expression to test for numeric values

2004-04-01 Thread Peter Guzis
-Users Subject: Regular expression to test for numeric values I've read the FAQ's on this, but they don't seem to answer the question. I have a variable that could contain any value( alpha, alpha-numeric, or numeric). If the value is NOT numeric, I need to change the variables'

Regular expression to test for numeric values

2004-04-01 Thread Motter, Jeffrey D
I've read the FAQ's on this, but they don't seem to answer the question. I have a variable that could contain any value( alpha, alpha-numeric, or numeric). If the value is NOT numeric, I need to change the variables' value to "0"( as in zero ). Examples: $txtype="2.314"; # is numeric, so keep t

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 qu

RE: regular expression replacement

2003-11-28 Thread shonorio
$Value = 'c:\qqq\www\'; $Value =~ s/\\/\//g; print $Value ; De: [EMAIL PROTECTED] em 28/11/2003 09:15 GMT Para: "'Kaufman Eran (StarHome)'" <[EMAIL PROTECTED]> [EMAIL PROTECTED] cc: Assunto: RE: regular expression replacement

RE: regular expression replacement

2003-11-28 Thread Beckett Richard-qswi266
Hi, I would like to know how can I replace the value c:\qqq\www\ to c:/qqq/www/. I tried several ways, but didn't manage to. Thanks, Eran s!\\!/!g ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveStat

RE: regular expression replacement

2003-11-28 Thread Kraaijer Ronald
How about a regular expressions like $string = 'c:\qqq\www\' ; $string =~ s/\\/\//g; That should do the trick. -Original Message- From: Kaufman Eran (StarHome) [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 05, 2003 10:38 AM To: [EMAIL PROTECTED] Subject: regular

regular expression replacement

2003-11-27 Thread Kaufman Eran (StarHome)
Hi,   I would like to know how can I replace the value c:\qqq\www\ to c:/qqq/www/. I tried several ways, but didn't manage to.   Thanks, Eran

RE: Regular Expression problem?

2003-09-26 Thread Carl Jolley
On Fri, 26 Sep 2003, Xu, Qiang (XSSC SGP) wrote: > Ted S. wrote: > > Beckett Richard-qswi266 graced perl with these words of wisdom: > >> That should have been s/.*\/// > > > > Don't you have to escape the period, too? > > > > s/\.*\/// > > No, we shouldn't, because here "." stands for any single

RE: Regular Expression problem?

2003-09-25 Thread Xu, Qiang (XSSC SGP)
Glenn Linderman wrote: > Any delimiter can be used (other posters were correct about that). > The delimiter used affects which delimiter character would need to be > escaped in the regular expression. Generally, if something other > than / is used as the delimiter character, it is ch

RE: Regular Expression problem?

2003-09-25 Thread Xu, Qiang (XSSC SGP)
Strohmeier Ruediger wrote: > Hi Xu Qiang, > > unlike e.g. awk, vi or the shell, perl support different delimiter > for regexes. When a slash is part of the regex or the substitution > pattern, they can either be escaped (i.e. \/) or other characters can > be used as delimiters. > > Thus the reg

RE: Regular Expression problem?

2003-09-25 Thread Xu, Qiang (XSSC SGP)
Ted S. wrote: > Beckett Richard-qswi266 graced perl with these words of wisdom: >> That should have been s/.*\/// > > Don't you have to escape the period, too? > > s/\.*\/// No, we shouldn't, because here "." stands for any single character except a new line. thx, Regards, Xu Qiang __

Re: Regular Expression problem?

2003-09-25 Thread Glenn Linderman
On approximately 9/25/2003 6:45 AM, came the following characters from the keyboard of Xu, Qiang (XSSC SGP): Hi, all: I have a regular expression that I can't understand. Suppose $filename is a file name that includes the full path. Say, it is "/u/scan/abc.jpg", The regula

Re: Perldoc problem was Re: regular expression on military time

2003-07-27 Thread John
t; Sent: Sunday, July 27, 2003 3:07 AM > Subject: Perldoc problem was Re: regular expression on military time > > >> If it does work, invoke 'path c:\perl\bin;%path%' at the prompt to >> change the path variable for the current console session then 'cd'

Re: Perldoc problem was Re: regular expression on military time

2003-07-27 Thread Ted S.
On 27 Jul 2003, Gerry Green wrote in perl: > Just a quick note: > > - Original Message - > From: "John" <[EMAIL PROTECTED]> > To: "Ted S." <[EMAIL PROTECTED]> > Cc: "Perl-Win32-Users" <[EMAIL PROTECTED]> > Sent: Sun

Re: Perldoc problem was Re: regular expression on military time

2003-07-27 Thread Gerry Green
Just a quick note: - Original Message - From: "John" <[EMAIL PROTECTED]> To: "Ted S." <[EMAIL PROTECTED]> Cc: "Perl-Win32-Users" <[EMAIL PROTECTED]> Sent: Sunday, July 27, 2003 3:07 AM Subject: Perldoc problem was Re: regular expression on

Perldoc problem was Re: regular expression on military time

2003-07-27 Thread John
On Saturday, July 26, 2003 12:05 AM AEST, Ted S. wrote: > On 25 Jul 2003, John McMahon wrote in perl: > >> Ted >> >> When you produced the output of 'set' below how did you get to the >> CLI console (command line interpreter aka DOS prompt)? This console >> was opened in the 'Windows' directory.

Re: regular expression on military time

2003-07-25 Thread Ted S.
On 25 Jul 2003, John McMahon wrote in perl: > Ted > > When you produced the output of 'set' below how did you get to the CLI > console (command line interpreter aka DOS prompt)? This console was > opened in the 'Windows' directory. > > What was different in *HOW* you got to this console *TO HOW*

RE: regular expression on military time

2003-07-21 Thread Carl Jolley
On Fri, 18 Jul 2003, Ted S. wrote: > On 18 Jul 2003, Carl Jolley wrote in perl: > > > On Thu, 17 Jul 2003, Ted S. wrote: > > > >> On 17 Jul 2003, Tobias Hoellrich wrote in perl: > >> > >> > my @t=("08:00", "23:59", "00:00", "aa:00", "24:00", " 00:01", > >> > "8:00", "08.00", "36:12", "08:61" ); fo

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
do something} }; Hope this helps, NuTs - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, March 28, 2003 9:40 AM Subject: regular expression question > Dear all > > I have a txt file like the bottom (I use cleardiff

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

regular expression question

2003-03-28 Thread Cai_Lixin
Dear all I have a txt file like the bottom (I use cleardiff to compare 2 files and get this file): I will check whether the line includes "___GENERIC_MULTILINE___" or not, if it includes, I will get the following information > GENERATION 116 > # Impossible dependency > # Needed to prevent FC47

Re: Beginner Regular Expression Question

2003-03-20 Thread C. Church
> Net::Telnet, and I want to match several possible strings that would make up > the prompts. An explanation below: > > '/br[0-9][0-9]/' "or" '/mar[0-9][0-9]/' "or" '/tr[0-9][0-9]/' "or" > '/ber[0-9]/' > One way is: if($string =~ /(?:b|t|be|ma)r[0-9]{2}/) { ... } The operative operator

Beginner Regular Expression Question

2003-03-20 Thread Lupi, Guy
I am trying to figure out how to specify "or" in a regular expression. Basically, I am specifying the Prompt portion of a telnet session using Net::Telnet, and I want to match several possible strings that would make up the prompts. An explanation below: '/br[0-9][0-9]/'

Re: Another regular expression question

2003-03-20 Thread Carl Jolley
s [mailto:[EMAIL PROTECTED] > Sent: Wednesday, March 19, 2003 6:24 PM > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: Re: an regular expression question > > > On 3/19/2003 6:16 PM, [EMAIL PROTECTED] wrote: > > All, > > > > A question: > > A f

RE: Another regular expression question

2003-03-20 Thread Scott Purcell
inal Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2003 9:28 AM To: [EMAIL PROTECTED] Subject: Another regular expression question Filename = "Base-02.04.1.20.5.002-xlite_katana_free.ndu"; I want to get extension of the file name whic

Re: Another regular expression question

2003-03-20 Thread kadir
Hi! On 20 Mar 2003 at 10:28, [EMAIL PROTECTED] wrote: > Filename = "Base-02.04.1.20.5.002-xlite_katana_free.ndu"; > > I want to get extension of the file name which is ndu, but I always > get 04.1.20.5.002-xlite_katana_free.ndu instead of ndu. : Try the code below. i think it works. Regards,

Re: Another regular expression question

2003-03-20 Thread Tobias Hoellrich
At 10:28 AM 3/20/2003 -0500, you wrote: Filename = "Base-02.04.1.20.5.002-xlite_katana_free.ndu"; I want to get extension of the file name which is ndu, but I always get 04.1.20.5.002-xlite_katana_free.ndu instead of ndu. The sub is like: sub extension { my $path = shift; my $ext

Re: Regular Expression matching problem

2003-03-14 Thread Carl Jolley
On Sun, 9 Mar 2003, Electron One wrote: > Hello Everyone, > > If I have a file that contains this, > > test3.txt## > wilma > > wimagren was here > > twilma was type wilma > > wilma > > wilma > > wilma > > twowilm

RE: Another Regular expression problem

2003-03-10 Thread Joseph P. Discenza
Electron One wrote, on Monday, March 10, 2003 13:12 : while(<>){ : chomp; : if(/\s*\$[a-z]\w+\s*/i){ : #if(/\b\$[a-z]\w+\b/i){ : print "Matched: $` -- $& -- $' :\n"; : } : else{ :print "No match:$_\n"; : } : } : : testfile.txt###

Re: Another Regular expression problem

2003-03-10 Thread Electron One
; > -Original Message- > > From: Electron One [mailto:[EMAIL PROTECTED] > > Sent: Monday, March 10, 2003 12:12 PM > > To: [EMAIL PROTECTED] > > Cc: Electron One > > Subject: Another Regular expression problem >

Re: Another Regular expression problem

2003-03-10 Thread Ted Zeng
Message- > > From: Electron One [mailto:[EMAIL PROTECTED] > > Sent: Monday, March 10, 2003 12:12 PM > > To: [EMAIL PROTECTED] > > Cc: Electron One > > Subject: Another Regular expression problem > > >

RE: Another Regular expression problem

2003-03-10 Thread Stovall, Adrian M.
> -Original Message- > From: Electron One [mailto:[EMAIL PROTECTED] > Sent: Monday, March 10, 2003 12:12 PM > To: [EMAIL PROTECTED] > Cc: Electron One > Subject: Another Regular expression problem > > > Hello Everyone, > >

Another Regular expression problem

2003-03-10 Thread Electron One
Hello Everyone, I have a perl file that has this, PerlFile.pl### #!/usr/bin/perl while(<>){ chomp; if(/\s*\$[a-z]\w+\s*/i){ #if(/\b\$[a-z]\w+\b/i){ print "Matched: $` -- $& -- $' :\n"; } el

AW: Regular Expression matching problem

2003-03-10 Thread Wittrock, Friedel
PROTECTED] Betreff: Re: Regular Expression matching problem Not if the fourth to sixth lines don't have a space before the end of line. Try if(/wilma\s*/). Actually, you'll need to use if(/wilma/g) to c

Re: Regular Expression matching problem

2003-03-10 Thread Phil Ritchie
| | cc: electron One <[EMAIL PROTECTED]> | | Subject: Regu

Re: Regular Expression matching problem

2003-03-09 Thread Keith C. Ivey
and I type, perl -w perlname.pl test3.txt > shouldnt the output be, "wilma was mentioned \n", 7 times? My > output file only mentions it once. What am I doing wrong? What do you think the '\s+' means in that regular expression? After you've chomped them, only one

Regular Expression matching problem

2003-03-09 Thread Electron One
Hello Everyone, If I have a file that contains this, test3.txt## wilma wimagren was here twilma was type wilma wilma wilma wilma twowilmase ###

Regular expression question

2002-12-12 Thread Mangesh
I want to translate some chaarcters in a string to its replacement string.   I am doing this. #** $inchar    = "\xa2\xa3";$outchar   = "\[Cent]\[Pound]"; eval "\$buf =~ tr/$inchar/$outchar/";   #$buf =~ s/$inchar/$outchar/; print

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
t; my code is like: > > if (!-z $file) > { > open(LOG_FILE, "<$file") or warn " can not open $file:$!\n"; > my @read_lines = ; > close (LOG_FILE); > next unless chomp($read_lines[0]) =~ m#\"\nest and \toolbox VOBs\"#; > }

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

  1   2   3   >