: beginners@perl.org
Subject: Re: Simple regex question
You wrote on 05/19/2009 03:18 PM:
> Simple question for the regEXperts out there...
>
> I have a string that is always in the format: a.nn+x.y
>
> a is always 5 chars
> n can be 1 or 2 digits
> x can be +/- (with sign), 1-4
Dan Fish wrote:
Simple question for the regEXperts out there...
I have a string that is always in the format: a.nn+x.y
a is always 5 chars
[a-zA-Z0-9]{5}
n can be 1 or 2 digits
[0-9]{1,2}
x can be +/- (with sign), 1-4 digits
[-+][0-9]{1,4}
y is always positive (no sign), 1
Chas. Owens wrote:
On Tue, May 19, 2009 at 09:55, Alexander Koenig wrote:
snip
($a,$n,$x,$y)) = $item =~ /(.{5})\.(\d\d?)[-+](\d{1,4})\.(\d{1,4})/;
snip
As of Perl 5.8 \d no longer matches [0-9].
^
As of Perl 5.8 \d no longer matches only [0-9].
Dan Fish wrote:
Simple question for the regEXperts out there...
I have a string that is always in the format: a.nn+x.y
a is always 5 chars
[a-zA-Z0-9]{5}
n can be 1 or 2 digits
[0-9]{1,2}
x can be +/- (with sign), 1-4 digits
[-+][0-9]{1,4}
y is always positive (no sign), 1
On Tue, May 19, 2009 at 10:21, Alexander Koenig wrote:
> Chas. Owens wrote on 05/19/2009 04:02 PM:
>
>>> ($a,$n,$x,$y)) = $item =~ /(.{5})\.(\d\d?)[-+](\d{1,4})\.(\d{1,4})/;
>> snip
>>
>> As of Perl 5.8 \d no longer matches [0-9]. It now matches any UNICODE
>> character that has the digit propert
Chas. Owens wrote on 05/19/2009 04:02 PM:
>> ($a,$n,$x,$y)) = $item =~ /(.{5})\.(\d\d?)[-+](\d{1,4})\.(\d{1,4})/;
> snip
>
> As of Perl 5.8 \d no longer matches [0-9]. It now matches any UNICODE
> character that has the digit property. This includes characters such
> as "\x{1815}" (MONGOLIAN DI
> > Simple question for the regEXperts out there...
> >
> > I have a string that is always in the format: a.nn+x.y
> >
> > a is always 5 chars
> > n can be 1 or 2 digits
> > x can be +/- (with sign), 1-4 digits
> > y is always positive (no sign), 1-4 digits
> snip
>
> What do you mean by char
A crude one
($part,$unit,$x,$y,$xlen,$ylen) = ($1,$2,$3,length($4),length($5))
if ($string =~ /(^\S{5})\.(\d{2})([+-])(\d+)\.(\d+)$/);
-Original Message-
From: Dan Fish [mailto:d...@ninemoons.com]
Sent: 19 May 2009 14:18
To: beginners@perl.org
Subject: Simple regex question
Simple
On Tue, May 19, 2009 at 09:55, Alexander Koenig wrote:
snip
> ($a,$n,$x,$y)) = $item =~ /(.{5})\.(\d\d?)[-+](\d{1,4})\.(\d{1,4})/;
snip
As of Perl 5.8 \d no longer matches [0-9]. It now matches any UNICODE
character that has the digit property. This includes characters such
as "\x{1815}" (MONGO
On Tue, May 19, 2009 at 09:18, Dan Fish wrote:
> Simple question for the regEXperts out there...
>
> I have a string that is always in the format: a.nn+x.y
>
> a is always 5 chars
> n can be 1 or 2 digits
> x can be +/- (with sign), 1-4 digits
> y is always positive (no sign), 1-4 digits
snip
You wrote on 05/19/2009 03:18 PM:
> Simple question for the regEXperts out there...
>
> I have a string that is always in the format: a.nn+x.y
>
> a is always 5 chars
> n can be 1 or 2 digits
> x can be +/- (with sign), 1-4 digits
> y is always positive (no sign), 1-4 digits
The best I ca
Simple question for the regEXperts out there...
I have a string that is always in the format: a.nn+x.y
a is always 5 chars
n can be 1 or 2 digits
x can be +/- (with sign), 1-4 digits
y is always positive (no sign), 1-4 digits
Some examples:
A123C.11+002.001
FC32G.2-1.0
Bill Harpley wrote:
Hi Gunnar,
I tried your suggestions but had no luck :-(
(1) I tried your idea of using a paragraph separator
local $/ = ''; # paragraph mode
while ( my $entry = ) {
if ( $entry =~ /\[([a-z0-9]{5})]/ ) {
print "$1\n";
Can you explain why this works but my orginal effort did not?
Many thanks,
Bill Harpley
-Original Message-
From: Rob Dixon [mailto:rob.di...@gmx.com]
Sent: Monday, January 26, 2009 7:19 PM
To: Perl Beginners
Cc: Bill Harpley
Subject: Re: Simple regex problem has me baffled
Bill Harple
each record into a single long
line before trying to perform regex match? Is there an easy way to do
this?
Regards,
Bill Harpley
-Original Message-
From: Gunnar Hjalmarsson [mailto:nore...@gunnar.cc]
Sent: Monday, January 26, 2009 5:22 PM
To: beginners@perl.org
Subject: Re: Simple re
it:]] but to no avail
So I remain stuck at square one !!
Regards,
Bill
-Original Message-
From: John W. Krahn [mailto:jwkr...@shaw.ca]
Sent: Monday, January 26, 2009 5:20 PM
To: Perl Beginners
Subject: Re: Simple regex problem has me baffled
Bill Harpley wrote:
> Hello,
He
uch as 'print
"$1\n";' in other scripts.
Regards,
Bill Harpley
-Original Message-
From: Mr. Shawn H. Corey [mailto:shawnhco...@magma.ca]
Sent: Monday, January 26, 2009 4:32 PM
To: Bill Harpley
Cc: beginners@perl.org
Subject: Re: Simple regex problem has
Bill Harpley wrote:
> Hello,
>
> I have simple regex problem that is driving me crazy.
>
> I am writing a script to analyse a log file. It contains Java related
> information about requests and responses.
>
> Each pair of Request (REQ) and Response (RES) calls have a u
Bill Harpley wrote:
[2009-01-23 09:20:48,719]TRACE [server-1] [http-80-5] a...@mydomain.net
:090123-092048567:f5825 (SetCallForwardStatusImpl.java:call:54) -
RequestId [81e80] SetCallForwardStatus.REQ { accountNumber:=W12345,
phoneNumber:=12121212121, onBusyStatus:=true, busyCurrent:=voicemail,
Bill Harpley wrote:
Hello,
Hello,
I have simple regex problem that is driving me crazy.
I am writing a script to analyse a log file. It contains Java related
information about requests and responses.
Each pair of Request (REQ) and Response (RES) calls have a unique
Request ID. This is a 5
On Mon, 2009-01-26 at 16:20 +0100, Bill Harpley wrote:
> foreach $entry(@list)
> {
>
> $entry =~ /\[([a-z0-9]{5})\]/;
>
> print "$1\n"; # print to screen
>
> # print FILE "$1\n";# print to file
> }
If there is no match, you are printing a uninitiali
Hello,
I have simple regex problem that is driving me crazy.
I am writing a script to analyse a log file. It contains Java related
information about requests and responses.
Each pair of Request (REQ) and Response (RES) calls have a unique
Request ID. This is a 5 digit hex number contained in
Hi George,
Are you looking for a TCL script or a PERL regex expression, if you are
using PERL
then try the code what Dmitry Motevich has written if u need in TCL then
try the below
---
set x "Linz_Untauglich Dr."
set result [regexp (_)(
George Homorozeanu am Mittwoch, 25. Januar 2006 16.12:
> I need it with RegEx, that's my problem.
>
> Thanks,
>
> George.
>
> "Xavier Noria" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> news:[EMAIL PROTECTED]
>
> > On Jan 25, 2006, at 12:23, George Homorozeanu wrote:
> >> I am very new in RegEx and
Hello George,
Wednesday, January 25, 2006, 1:23:41 PM, you wrote:
GH> Hi,
GH> I am very new in RegEx and I want to be able to write an expresion that
does
GH> the following:
GH> Return all the characters from a string starting from the 5-th character.
GH> Given:
GH> Linz_Untauglich Dr.
GH>
I need it with RegEx, that's my problem.
Thanks,
George.
"Xavier Noria" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> On Jan 25, 2006, at 12:23, George Homorozeanu wrote:
>
>> I am very new in RegEx and I want to be able to write an expresion that
>> does
>> the followin
> "George" == "George Homorozeanu" <[EMAIL PROTECTED]> writes:
George> Hi,
George> I am very new in RegEx and I want to be able to write an expresion that
does
George> the following:
George> Return all the characters from a string starting from the 5-th
character.
Call me paranoid, but th
On Jan 25, 2006, at 12:23, George Homorozeanu wrote:
I am very new in RegEx and I want to be able to write an expresion
that does
the following:
Return all the characters from a string starting from the 5-th
character.
You want to do it with a regexp for some particular reason? That's
t
Hi,
I am very new in RegEx and I want to be able to write an expresion that does
the following:
Return all the characters from a string starting from the 5-th character.
Given:
Linz_Untauglich Dr.
Result:
Untauglich Dr.
Thanks,
George.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For add
In a message dated 4/17/2004 10:33:51 AM Eastern Daylight Time,
[EMAIL PROTECTED] writes:
>why was ^[^\.]+ suggested rather than ^.*?\. as a pattern.
I just Benchmarked it. qr(^.*?\.) is faster.
#!/usr/bin/perl
use strict;
use warnings;
use Benchmark qw/cmpthese/;
cmpthese(0, {
'^[^\.]+
I see people have explained the regex itself but not how it's doing
what you want.
It's actually removing everything up until a dot is found
s/// is used to find and replace so this little regex is searching your
string eg http:://www.domain4you.com
finding everything up until a dot is found i
Please bottom post
> Thanks for the small tutorial - but I must admit that I can only see
> (according to your explanation) the regex to be matching anything except
> a dot. So substituting them should return only 1 or more dots.
Two points here
1. + is greedy meaning it keeps matching
Subject: Re: What exactly is this simple regex doing?
||>
||> Please bottom post
||>
||> >
||> > This regex by Rob is working alright, but can't follow exactly how
it
||> > truncates an absolute url from first character to the one before
the
||> >
Please bottom post
>
> This regex by Rob is working alright, but can't follow exactly how it
> truncates an absolute url from first character to the one before the
> dot.
>
> It returns (.domain4you.com from http:://www. domain4you.com.) exactly
> what is expected, but I can't easily underst
This regex by Rob is working alright, but can't follow exactly how it
truncates an absolute url from first character to the one before the
dot.
It returns (.domain4you.com from http:://www. domain4you.com.) exactly
what is expected, but I can't easily understand it.
Please I'm not pulling anyone
Rob Hanson wrote:
>
> Try this...
>
> # untested
> $text =~ s/\[[^\]]+?\]/$1/g;
>
> [^\]] - means anything but a closing bracket
> +? - means 1 or more times (as few as possible)
Hi Rob
You're not capturing $1, so you would be replacing them and
their contents with 'undef'. (The opposite of what
On 4/15/2004 7:10 PM, [EMAIL PROTECTED] wrote:
How can I write a regular expression to keep the part of a string that's
between a pair of square braces? Here's a sample line:
Updating Wellbore Set Keys: [wlbr_id = 1234567890, data_provider_code =
MTBL, welltype = OIL]
use Text::Balanced; # includ
On Apr 15, 2004, at 6:22 PM, James Edward Gray II wrote:
On Apr 15, 2004, at 6:10 PM, [EMAIL PROTECTED] wrote:
How can I write a regular expression to keep the part of a string
that's
between a pair of square braces? Here's a sample line:
Updating Wellbore Set Keys: [wlbr_id = 1234567890, data
On Apr 15, 2004, at 6:10 PM, [EMAIL PROTECTED] wrote:
How can I write a regular expression to keep the part of a string
that's
between a pair of square braces? Here's a sample line:
Updating Wellbore Set Keys: [wlbr_id = 1234567890, data_provider_code =
MTBL, welltype = OIL]
Maybe:
s/^[^[]]*\[
In a message dated 4/15/2004 7:13:09 PM Eastern Daylight Time,
[EMAIL PROTECTED] writes:
>How can I write a regular expression to keep the part of a string that's
>between a pair of square braces? Here's a sample line:
>
>Updating Wellbore Set Keys: [wlbr_id = 1234567890, data_provider_code =
>MT
: Simple regex
How can I write a regular expression to keep the part of a string that's
between a pair of square braces? Here's a sample line:
Updating Wellbore Set Keys: [wlbr_id = 1234567890, data_provider_code =
MTBL, welltype = OIL]
Thanks in advance for your help!
Scott
Scott E
How can I write a regular expression to keep the part of a string that's
between a pair of square braces? Here's a sample line:
Updating Wellbore Set Keys: [wlbr_id = 1234567890, data_provider_code =
MTBL, welltype = OIL]
Thanks in advance for your help!
Scott
Scott E. Robinson
SWAT Team
Data
Rob Dixon wrote:
>> you want to know what's failing, right?
>
> Wrong. John was just pointing out that $1 would remain
> defined from a previous regex match in my previous post.
> This would mean that there was no way of telling in
> retrospect if the match had suceeded. The context of
> the prob
Hi Scott.
Scott R. Godin wrote:
> Rob Dixon wrote:
>
> > Paul Johnson wrote:
> > > Rob Dixon said:
> > >
> > > > $data =~ m/ <([^>]*)> /x;
> > > > my $newdata = $1;
> > >
> > > And if the match fails?
> >
> > Well I think it's likely that you'd want to do:
> >
> > $data =~ m/ <([^>]*)>
Rob Dixon wrote:
> Paul Johnson wrote:
>> Rob Dixon said:
>>
>> > $data =~ m/ <([^>]*)> /x;
>> > my $newdata = $1;
>>
>> And if the match fails?
>
> Well I think it's likely that you'd want to do:
>
> $data =~ m/ <([^>]*)> /x or die "Malformed data";
>
> or at least:
>
> $data
David wrote:
> Gregg R . Allen wrote:
>
>> It was close but what I got is : "JohnDoe.com" Instead of
>> "[EMAIL PROTECTED]".
>>
>> I think it has something to do with escaping the "@" sign. I've been
>> experimenting, but without much luck.
>>
>
> that's because Perl thinks @Someplace is an
Paul Johnson wrote:
> Rob Dixon said:
>
> > $data =~ m/ <([^>]*)> /x;
> > my $newdata = $1;
>
> And if the match fails?
Well I think it's likely that you'd want to do:
$data =~ m/ <([^>]*)> /x or die "Malformed data";
or at least:
$data =~ m/ <([^>]*)> /x or next;
as a mismatch
Rob Dixon said:
> $data =~ m/ <([^>]*)> /x;
> my $newdata = $1;
And if the match fails?
--
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
David --- Senior Programmer Analyst --- Wgo Wagner wrote:
> I had to change as follows:
> my $data = 'BlahBlahBlahBlah From: BlahsvilleDude
> <[EMAIL PROTECTED]>BlahBBlahBBlah';
>
> printf "bf:%-s\n", $data;
>
> $data =~ s/^.*<([^>]*)>.*$/$1/gs;
>
> printf "af:%-s\n", $data;
>
> but it does work t
Rob Hanson wrote:
> Try this...
>
> my $data = "BlahBlahBlahBlah From: BlahsvilleDude
> <[EMAIL PROTECTED]>BlahBBlahBBlah"
> $data =~ s/^.*<([^>]*)>.*$/$1/;
Hi Rob.
Anchoring the search at the start of the string and then allowing
'any number of anything' is the same as not anchoring it! Likewis
stop trapping text
>> .* = anything, zero or more times
>> $ = end of string
>> /$1/ = replace matched text with the trapped text
>>
>> Rob
>>
>> -Original Message-
>> From: Gregg R. Allen [mailto:[EMAIL PROTECTED]
>> Sent: Tuesday, March
Gregg R . Allen wrote:
> It was close but what I got is : "JohnDoe.com" Instead of
> "[EMAIL PROTECTED]".
>
> I think it has something to do with escaping the "@" sign. I've been
> experimenting, but without much luck.
>
that's because Perl thinks @Someplace is an array. if you have warning
Hi -
> -Original Message-
> From: Gregg R. Allen [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, March 04, 2003 2:16 PM
> To: Hanson, Rob
> Cc: Gregg R. Allen; [EMAIL PROTECTED]
> Subject: Re: Simple Regex Problem.
>
>
> It was close but what I got is : "Jo
ng text
[^>]* = anything but ">", zero or more times
)> = stop trapping text
.* = anything, zero or more times
$ = end of string
/$1/ = replace matched text with the trapped text
Rob
-Original Message-
From: Gregg R. Allen [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 04,
gt;]* = anything but ">", zero or more times
)> = stop trapping text
.* = anything, zero or more times
$ = end of string
/$1/ = replace matched text with the trapped text
Rob
-Original Message-
From: Gregg R. Allen [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 04, 2003 5:25
So my boss just told me that he doesn't like the fact that the "From:"
field in our email database typically looks like:
"BlahBlahBlahBlah From: BlahsvilleDude
<[EMAIL PROTECTED]>BlahBBlahBBlah"
(The "blahs", of course, are not literal, but can be anything.)
He wants the subject field to look
R. Joseph Newton wrote:
Ramprasad wrote:
hello all,
I have a file read into a single string, and I want to write a regex
that will tell me wether the file contains any non hashed line
__DATA__
## FORWARD
## FORWARD
## VACATION
## VACATION
__END__
But my regex fails in case of any blank lines o
Ramprasad wrote:
> hello all,
>
> I have a file read into a single string, and I want to write a regex
> that will tell me wether the file contains any non hashed line
>
> __DATA__
> ## FORWARD
> ## FORWARD
> ## VACATION
> ## VACATION
> __END__
>
> But my regex fails in case of any blank lines or
Ramprasad wrote:
hello all,
I have a file read into a single string, and I want to write a regex
that will tell me wether the file contains any non hashed line
This is my test script
#!/usr/bin/perl
#
{
local($/)=undef;
$str=;
}
print $str;
if($str=~/^\s*[^#]/m){
print "NOT ENTIRELY COMMENT
hello all,
I have a file read into a single string, and I want to write a regex
that will tell me wether the file contains any non hashed line
This is my test script
#!/usr/bin/perl
#
{
local($/)=undef;
$str=;
}
print $str;
if($str=~/^\s*[^#]/m){
print "NOT ENTIRELY COMMENT";
} else {
pri
On Nov 20, Marco Centemeri said:
>How can I know if a variable is exactly 6 digit long?
if ($str =~ /\A\d{6}\z/) { ... }
The \A matches the beginning of the string, \d{6} matches 6 digits, and
the \z matches the end of the string.
If you meant "characters" instead of "digits", don't use a reg
perldoc -f length
http://danconia.org
On Wed, 20 Nov 2002 16:03:35 +0100, Marco Centemeri <[EMAIL PROTECTED]> wrote:
> Hi All!!
>
> How can I know if a variable is exactly 6 digit long?
>
> I tried:
>
>$myvar='ABCDEF';
>if ($myvar =~ /
Hi All!!
How can I know if a variable is exactly 6 digit long?
I tried:
$myvar='ABCDEF';
if ($myvar =~ /.{6}/) {
print "TRUE";}
else {
print "FALSE";}
and I found that this expression is alway TRUE for {..}<=6 and become
FALSE for {..}>=7 .
Thank for help
Ma
Lance Murray wrote:
>
> Hello
Hello,
> I'm trying to write a simple script to test if a port is up or down. It all
> depends on being able to parse for the word "Connected" in an array. Try as
> I might, I can't figure out why the following regex comparison won't work.
Perhaps you need the
g read into a scalar:
if ($reply =~ m/Connected/s) { ...
's' says search thru new lines.
Aloha => Beau.
-Original Message-
From: Lance Murray [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 16, 2002 10:59 AM
To: [EMAIL PROTECTED]
Subject: SIMPLE regex expression compar
On Oct 16, Lance Murray said:
>#!/bin/perl
You should get used to using 'strict' and warnings
#!/bin/perl -w
use strict;
>$host = @ARGV[0];
That should be $ARGV[0].
>$port = @ARGV[1];
Why not:
my ($host, $port) = @ARGV;
>@reply = `echo " " | telnet $host $port`;
>if $reply[1] =~ /Co
Hello
I'm trying to write a simple script to test if a port is up or down. It all depends
on being able to parse for the word "Connected" in an array. Try as I might, I can't
figure out why the following regex comparison won't work.
if $reply[1] =~ /Connected/ {
The code snippet is as fol
11, 2002 8:26 AM
To: Bob Showalter; [EMAIL PROTECTED]
Subject: RE: Simple RegEx Question
Thanks Nikola and Bob.
Would "anchoring with \z" tantamount to having a
trailing "$"? In other words, are the following
expressions one and the same?
/^[0-9a-fA-F]+\z/
/^[0-9a-fA-F]+$/
_
Thanks Nikola and Bob.
Would "anchoring with \z" tantamount to having a
trailing "$"? In other words, are the following
expressions one and the same?
/^[0-9a-fA-F]+\z/
/^[0-9a-fA-F]+$/
__
Yahoo! - We Remember
9-11: A tribute to the more than 3
ola Janceski; [EMAIL PROTECTED]
Subject: RE: Simple RegEx Question
use strict;
while(){
chomp;
if(/[^0-9a-fA-F]+/){
print("$_ is not a hexadecimal number!\n");
}else{
print("$_ is a hexadecimal number!\n");
}
}
__DATA__
f4dxf
ffaa99
gxad
2832
2842da
--- N
use strict;
while(){
chomp;
if(/[^0-9a-fA-F]+/){
print("$_ is not a hexadecimal number!\n");
}else{
print("$_ is a hexadecimal number!\n");
}
}
__DATA__
f4dxf
ffaa99
gxad
2832
2842da
--- Nikola Janceski <[EMAIL PROTECTED]>
wrote:
> give us a snippet of your code. you made a mist
> -Original Message-
> From: RTO RTO [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, September 11, 2002 11:00 AM
> To: [EMAIL PROTECTED]
> Subject: Simple RegEx Question
>
>
> Here is a RegEx that I am using to check if the given
> string is Hexadecimal or not.
give us a snippet of your code. you made a mistake somewhere.
and give us examples of what the variables contain.
-Original Message-
From: RTO RTO [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 11, 2002 11:09 AM
To: Nikola Janceski; [EMAIL PROTECTED]
Subject: RE: Simple RegEx
iginal Message-
> From: RTO RTO [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, September 11, 2002 11:00 AM
> To: [EMAIL PROTECTED]
> Subject: Simple RegEx Question
>
>
> Here is a RegEx that I am using to check if the
> given
> string is Hexadecimal or not.
>
> /[^0
see below
/^[^0-9a-fA-F]+$/ #if this evals to true string is NOT
## start of string ^ and end of string $
-Original Message-
From: RTO RTO [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 11, 2002 11:00 AM
To: [EMAIL PROTECTED]
Subject: Simple RegEx Question
Here is a RegEx
Here is a RegEx that I am using to check if the given
string is Hexadecimal or not.
/[^0-9a-fA-F]+/ #if this evals to true string is NOT
hex
I am having a trailing "+" to make sure at least one
permissible character is present. Yet, it matches an
empty string as a hex string.
a) What am I mis
Ah... i see.
in scalar context, it returns false until left is true. then returns true
until right is true.
just what we want. very handy.
thanks.
On Saturday, March 30, 2002, at 11:48 AM, Jenda Krynicky wrote:
> From: bob ackerman <[EMAIL PROTECTED]>
>> sorry. still in dark.
>
From: bob ackerman <[EMAIL PROTECTED]>
> sorry. still in dark.
> what exactly does '/START_KEYWORD/.../END_KEYWORD/' mean?
> I see a regex -> /START_KEYWORD/
> an ellipsis -> ...
> and a regex -> /END_KEYWORD/
> you are saying the whole thing means something, but I don't underst
sorry. still in dark.
what exactly does '/START_KEYWORD/.../END_KEYWORD/' mean?
I see a regex -> /START_KEYWORD/
an ellipsis -> ...
and a regex -> /END_KEYWORD/
you are saying the whole thing means something, but I don't understand
what.
you say 'the elipsis returns false'
what does that mean? w
From: bob ackerman <[EMAIL PROTECTED]>
> i don't understand your answer. how will that match anything?
> the first line matches the whole block ok, but then the match is
> dropped by the '!' phrases since they are in the text. also, where is
> documented the ellipsis in a grep?
i don't understand your answer. how will that match anything?
the first line matches the whole block ok, but then the match is dropped
by the '!' phrases
since they are in the text.
also, where is documented the ellipsis in a grep?
also, using two regexes on either side of the ellipsis?
On Satu
From: Rob Lee <[EMAIL PROTECTED]>
> I'm parsing a file with multiple Fortran-like blocks that look like:
> START_KEYWORD
> line 1
> line 2
> END_KEYWORD
>
> I want only the contents of each block, not the keywords.
>
> grep { /START_KEYWORD/.../END_KEYWORD/ }
> returns
I'm parsing a file with multiple Fortran-like blocks that look like:
START_KEYWORD
line 1
line 2
END_KEYWORD
I want only the contents of each block, not the keywords.
grep { /START_KEYWORD/.../END_KEYWORD/ }
returns the entire block - including t
Yes, I am in fact changing the template file. Personally my first experience
with CGI::FastTemplate has made me wish it were a bit more flexible, but
I suppose it's certainly conceivable that the flexibility is there and I
just haven't found it based on what I read in perldoc.
-Ian
-- Original
On Jan 10, [EMAIL PROTECTED] said:
>>Personally, I find that odd -- moving from an array of 21 elements to 21
>>DIFFERENT scalars?!
>
>You're right, it is odd. But unless I've missed how to take a populated
>array and create a usable hash from it to pass to CGI::FastTemplate, this
>is what I bel
Jeff et al,
>>I have a file which has many strings like "$something[0]" through
>>"something[20]" amongst other text (quotes only provided here for
>>clarity).
>>
>>What I want to do is replace these strings with: "$SOMETHING0" through
>>"$SOMETHING20".
>
>Personally, I find that odd -- moving fr
On Jan 10, [EMAIL PROTECTED] said:
>I have a file which has many strings like "$something[0]" through
>"something[20]" amongst other text (quotes only provided here for
>clarity).
>
>What I want to do is replace these strings with: "$SOMETHING0" through
>"$SOMETHING20".
Personally, I find that o
Hello All,
I know this is very basic and similar items have come up numerous times
on this list, but I'm not sure where my boneheaded mistake is here.
I have a file which has many strings like "$something[0]" through "something[20]"
amongst other text (quotes only provided here for clarity).
Wh
Sorry. Ignore that. It's 5:30 and home time. What can I say.
Use this instead.
$dnvalue =~ /CN=(\w*)/;
$username = $1;
print $username
-Original Message-
From: John Edwards [mailto:[EMAIL PROTECTED]]
Sent: 28 June 2001 17:31
To: 'Mike Ring'; [EMAIL PROTECTED]
Subject: R
numbers. If you don't mind matching on an underscore too (_) use the
following instead
$dnvalue =~ /(CN=\w*)/;
HTH
John
-Original Message-
From: Mike Ring [mailto:[EMAIL PROTECTED]]
Sent: 28 June 2001 17:17
To: [EMAIL PROTECTED]
Subject: simple regex question
Hello all.
I
--- Mike Ring <[EMAIL PROTECTED]> wrote:
> I've learned a bit about regular expressions today. I have a string
> formatted
> like "CN=foo,OU=bar,O=pah" and I need to parse out "foo". I have
> created the
> following code which does work:
>
> $dnvalue =~ m/([^,]*)/;
> $username = $1;
> $username
Hello all.
I've learned a bit about regular expressions today. I have a string formatted
like "CN=foo,OU=bar,O=pah" and I need to parse out "foo". I have created the
following code which does work:
$dnvalue =~ m/([^,]*)/;
$username = $1;
$username =~ s/(CN=)//;
print $username
However, I'd lik
92 matches
Mail list logo