On Mar 28, 2023, at 3:00 PM, Martin McCormick wrote:
>
> Uri Guttman writes:
>> yes, but he kept the {5,} repeat count. so i just kept it too.
>
> Now that I know how this works, I will probably change to
> {4,} as this would match 4 or more digits. From reading the
> documentation, {4} means
Uri Guttman writes:
> yes, but he kept the {5,} repeat count. so i just kept it too.
Now that I know how this works, I will probably change to
{4,} as this would match 4 or more digits. From reading the
documentation, {4} means 4 and only 4. {4,6} means 4 but nothing
else except 6.
Uri Guttman writes:
> you also quoted the whole regex in '' but included the // which are the
> normal regex delimiters. remove the outer quotes.
> and use the qr// form for regexes.
> and you don't want the + after the \d as the {5,} is the count. you can't
> have both types of repeat counts.
>
On 3/28/23 16:07, Uri Guttman wrote:
On 3/28/23 17:01, Martin McCormick wrote:
Uri Guttman writes:
why are you escaping the {}?? those are meta chars that are needed to
make
that a 5+ range. just delete the backslashes on them and it will work.
First, thank you but read on, please.
Uri Guttman writes:
> why are you escaping the {}?? those are meta chars that are needed to make
> that a 5+ range. just delete the backslashes on them and it will work.
First, thank you but read on, please.
I couldn't agree more. That should do it but when I
don't escape them,
On 3/28/23 16:17, Martin McCormick wrote:
The string I am interested in testing for starts with 5
or 6 digits in a row and all I need to do is determine that the
first 5 or 6 characters are numbers Period. That's all.
my $regextest = '/^\d+\{5,\}/' ;
why are you escaping the {}??
I've been fighting this for several days and it is a very simple
regular expression problem that should be easy enough for a
second grader but I can't seem to get it to work.
The string I am interested in testing for starts with 5
or 6 digits in a row and all I need to do is determine
Hello
On Nov 18, 8:18 pm, [EMAIL PROTECTED] (Rob Coops) wrote:
If you want to capture both lines you end up doing
somehting like this: (.*){0,1}$
Thanks.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
Rob Coops wrote:
On Tue, Nov 18, 2008 at 9:52 AM, howa [EMAIL PROTECTED] wrote:
Hello,
I have two strings:
1. abc
2. abc
The line of string might end with or not, so I use the expression:
(.*)[$]
Why it didn't work out?
This does not work because $ denotes the end of the
Hello,
I have two strings:
1. abc
2. abc
The line of string might end with or not, so I use the expression:
(.*)[$]
Why it didn't work out?
Thanks.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
-Original Message-
From: howa [mailto:[EMAIL PROTECTED]
Sent: 18 November 2008 08:53
To: beginners@perl.org
Subject: Regular expression problem
Hello,
I have two strings:
1. abc
2. abc
The line of string might end with or not, so I use the expression
On Tue, 2008-11-18 at 00:52 -0800, howa wrote:
Hello,
I have two strings:
1. abc
2. abc
The line of string might end with or not, so I use the expression:
(.*)[$]
Why it didn't work out?
Inside the [] the meta-character loose their meaning. Only ^ and - have
special
On Tue, Nov 18, 2008 at 9:52 AM, howa [EMAIL PROTECTED] wrote:
Hello,
I have two strings:
1. abc
2. abc
The line of string might end with or not, so I use the expression:
(.*)[$]
Why it didn't work out?
Thanks.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional
-Original Message-
From: Stewart Anderson
Sent: 18 November 2008 12:20
To: beginners@perl.org
Cc: Stewart Anderson
Subject: RE: Regular expression problem
-Original Message-
From: howa [mailto:[EMAIL PROTECTED]
Sent: 18 November 2008 08:53
To: beginners@perl.org
howa wrote:
Hello,
Hello,
I have two strings:
1. abc
2. abc
The line of string might end with or not, so I use the expression:
(.*)[$]
Why it didn't work out?
$ perl -le'
for ( abc, abc ) {
print;
print $1 if /(.*)[$]/;
}
'
abc
Unmatched [ in regex; marked by -- HERE in
On Tue, Nov 18, 2008 at 07:19, Mr. Shawn H. Corey [EMAIL PROTECTED] wrote:
snip
Inside the [] the meta-character loose their meaning. Only ^ and - have
special meaning. You have to use | instead.
snip
You missed \, ], and the regex delimiter (default /, but could be
nearly anything). Also,
On Aug 1, 9:28 am, [EMAIL PROTECTED] wrote:
I'm trying to substitute all comma separated numbers in a text file
with the same numbers without commas. This expression will match the
numbers: \d{1,3}?(,\d\d\d)+ but how do i refer to each 3 digit block
after the commas so i can substitute for
I'm trying to substitute all comma separated numbers in a text file
with the same numbers without commas. This expression will match the
numbers: \d{1,3}?(,\d\d\d)+ but how do i refer to each 3 digit block
after the commas so i can substitute for them? $1 here just returns
the last 3 digit
Try looking up the 'g' modifier for regular expressions.
http://perldoc.perl.org/perlre.html
On Fri, Aug 1, 2008 at 10:28 AM, [EMAIL PROTECTED] wrote:
I'm trying to substitute all comma separated numbers in a text file
with the same numbers without commas. This expression will match the
[EMAIL PROTECTED] wrote:
I'm trying to substitute all comma separated numbers in a text file
with the same numbers without commas. This expression will match the
numbers: \d{1,3}?(,\d\d\d)+ but how do i refer to each 3 digit block
after the commas so i can substitute for them? $1 here just
[EMAIL PROTECTED] wrote:
I'm trying to substitute all comma separated numbers in a texv dile
with the same numbers without commas. This expression will match the
numbers: \d{1,3}?(,\d\d\d)+ but how do i refer to each 3 digit block
after the commas so i can substitute for them? $1 here just
John W. Krahn wrote:
[EMAIL PROTECTED] wrote:
I'm trying to substitute all comma separated numbers in a texv dile
with the same numbers without commas. This expression will match the
numbers: \d{1,3}?(,\d\d\d)+ but how do i refer to each 3 digit block
after the commas so i can substitute for
HI
I keep getting errors saying:
Use of uninitialized value in concatenation (.) or string at
pagecreate.pl line 25.
print() on closed filehandle FILE at pagecreate.pl line 29.
i have a script which calls a database and there are values in $ary[0] like:
bob smith
joe
susan / john
larry jones /
solved the first problem:
while (@ary = $sth-fetchrow_array()){
if ($ary[0] =~ /\//) {
@parts = split /\s/, $ary[0];
open FILE, c:\/\/output\/$ary[1]\/$parts[0]$ending\n;
From: Brad Cahoon [EMAIL PROTECTED]
I keep getting errors saying:
Use of uninitialized value in concatenation (.) or string at
pagecreate.pl line 25.
Apparently one of the variables you use on that line is not
initialized. Do you know which one?
print() on closed filehandle FILE at
Mr. Shawn H. Corey wrote:
[EMAIL PROTECTED] wrote:
Morning All,
I've a relatively minor problem that has been giving me a headache for
several days. I know there are many other ways to do this, however I'd
like to know why this isn't working. The snippet of code in question
is as
like to know why this isn't working. The snippet
of code in question
is as follows
snip
if($ARGV[2] =~ /port/i $ARGV[3] =~ /nick/i)
{
snip
Well, on a hunch I'd say that snippet returns false
because either
$ARGV[2] doesn't match /port/i, or because $ARGV[3]
doesn't match /
On Aug 10, 6:26 am, [EMAIL PROTECTED] wrote:
Morning All,
I've a relatively minor problem that has been giving me a headache for
several days. I know there are many other ways to do this, however I'd
like to know why this isn't working. The snippet of code in question
is as follows
snip
Morning All,
I've a relatively minor problem that has been giving me a headache for
several days. I know there are many other ways to do this, however I'd
like to know why this isn't working. The snippet of code in question
is as follows
snip
if($ARGV[2] =~ /port/i $ARGV[3] =~ /nick/i)
{
snip
On Aug 10, 8:28 am, [EMAIL PROTECTED] wrote:
I ought clarify.
No, you ought to post a short-but-complete script to start with, and
not assume you know what one specific line of the program is causing
problems.
It's not a problem with the command line, or anything like that, it's
a problem
On Aug 10, 9:27 am, [EMAIL PROTECTED] (Oryann9) wrote:
Another hunch looking at your syntax, ideally you
should be using the lesser precedence operator 'and'
instead of the higher precedence operator ''. Yes
plz show the command line string. :)
if($ARGV[2] =~ /port/i and $ARGV[3] =~ /nick/i)
[EMAIL PROTECTED] wrote:
Morning All,
I've a relatively minor problem that has been giving me a headache for
several days. I know there are many other ways to do this, however I'd
like to know why this isn't working. The snippet of code in question
is as follows
snip
if($ARGV[2] =~ /port/i
[EMAIL PROTECTED] wrote:
Mr. Shawn H. Corey wrote:
[EMAIL PROTECTED] wrote:
Morning All,
I've a relatively minor problem that has been giving me a headache for
several days. I know there are many other ways to do this, however I'd
like to know why this isn't working. The snippet
[EMAIL PROTECTED] wrote:
Mr. Shawn H. Corey wrote:
[EMAIL PROTECTED] wrote:
Morning All,
I've a relatively minor problem that has been giving me a headache for
several days. I know there are many other ways to do this, however I'd
like to know why this isn't working. The snippet
[EMAIL PROTECTED] wrote:
Mr. Shawn H. Corey wrote:
[EMAIL PROTECTED] wrote:
Morning All,
I've a relatively minor problem that has been giving me a headache
for
several days. I know there are many other ways to do this, however
I'd
like to know why this isn't working. The
: RE: simple regular expression problem
Khairul Azmi wrote:
Hi all,
I am a newbie. I just need to extract the string containing the unix
account from the following text
[EMAIL PROTECTED] SIZE=1024.
I'm guessing you want to extract the string user? (But how do you know
that that corresponds
that I've been reasonably accurate with my
assessment.
Steve
Thanks
AD
-Original Message-
From: Bob Showalter [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 19, 2004 8:57 AM
To: 'Khairul Azmi'; [EMAIL PROTECTED]
Subject: RE: simple regular expression problem
Khairul Azmi
: Tuesday, October 19, 2004 8:57 AM
To: 'Khairul Azmi'; [EMAIL PROTECTED]
Subject: RE: simple regular expression problem
Khairul Azmi wrote:
Hi all,
I am a newbie. I just need to extract the string containing the unix
account from the following text
[EMAIL PROTECTED] SIZE=1024.
I'm guessing
Steve Bertrand wrote:
...
while ($buf = FILE) {
# $buf now contains line of file, one per each loop of while
$buf =~ /(\w+)/;
$userName = $1;
...do something with $userName
}
This is a common error. You should not use $1 without making sure the regex
did in fact match.
Steve Bertrand wrote:
...
while ($buf = FILE) {
# $buf now contains line of file, one per each loop of while
$buf =~ /(\w+)/;
$userName = $1;
...do something with $userName
}
This is a common error. You should not use $1 without making sure the
regex
did in fact match.
Hi all,
I am a newbie. I just need to extract the string containing the unix
account from the following text
[EMAIL PROTECTED] SIZE=1024.
Can anyone tell me how to do it in perl? Thanks in advance.
Azmi
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
Khairul Azmi wrote:
I just need to extract the string containing the unix account from
the following text
[EMAIL PROTECTED] SIZE=1024.
Can anyone tell me how to do it in perl?
Try the docs.
perldoc perlrequick
perldoc perlretut
perldoc perlre
Thanks in advance.
You're welcome.
--
Khairul Azmi wrote:
Hi all,
I am a newbie. I just need to extract the string containing the unix
account from the following text
[EMAIL PROTECTED] SIZE=1024.
I'm guessing you want to extract the string user? (But how do you know
that that corresponds to a Unix account?)
The following will
= administratively down
*
Thanks
Rajeev
-Original Message-
From: Rob Dixon [mailto:[EMAIL PROTECTED]
Sent: Saturday, July 05, 2003 8:21 PM
To: [EMAIL PROTECTED]
Subject: Re: Regular expression problem.
Pandey Rajeev-A19514 wrote:
Hi,
Can anyone give me a regular
Hi,
Can anyone give me a regular expression(perhaps a one liner) ?
Matching an expression in a single line is easy. But if I have to find it out in a
array of scalars, it becomes tricky for me.
An excerpt of my output buffer looks like this.
Pandey Rajeev-A19514 wrote:
Hi,
Can anyone give me a regular expression(perhaps a one liner) ?
Matching an expression in a single line is easy. But if I have to find it out in a
array of scalars, it becomes tricky for me.
An excerpt of my output buffer looks like this.
On Jul 5, Pandey Rajeev-A19514 said:
***
ifEntry.1.13 = 13
ifEntry.2.13 = FastEthernet3/9
ifEntry.3.13 = 6
lifEntry.20.13 = administratively down
Jul 5 03:22:33.851 cst: SNMP: Queuing packet to 10.3.0.1
Jul 5 03:22:33.851 cst:
47 matches
Mail list logo