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
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
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
>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
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 &
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
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
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
__
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
__
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
"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
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:
***
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
$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
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
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
$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
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
\\ 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.
>
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
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
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
$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
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.
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
-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
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
[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
/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
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
-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
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
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
-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
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
$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
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
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,
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
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
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
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
> 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
_
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
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";);
>
>
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
> 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
"
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
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
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
-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
-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'
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
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
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
$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
$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
> [
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
$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
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
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
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
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
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
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
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
__
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
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'
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
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
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.
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*
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
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
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
>
> 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
___
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
>
>
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
[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
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
> 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
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]/'
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
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
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,
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
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
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###
; > -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
>
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
> >
>
> -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,
>
>
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
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
|
| cc: electron One <[EMAIL PROTECTED]>
|
| Subject: Regu
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
Hello Everyone,
If I have a file that contains this,
test3.txt##
wilma
wimagren was here
twilma was type wilma
wilma
wilma
wilma
twowilmase
###
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
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
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\"#;
> }
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 - 100 of 217 matches
Mail list logo