On Sun, Jan 18, 2015 at 9:28 AM, Jim Gibson wrote:
>
>> On Jan 18, 2015, at 9:03 AM, Mike wrote:
>>
>> I was able to find match extraction in the perldoc.
>>
>> Here is a snippet of what I have.
>>
>> my $insult = ( $mech->text =~ m/Insulter\ (.*)\ Taken/ );
>> print "$insult\n";
>>
>> But $insul
Thanks. This worked.
On 1/18/15 12:28 PM, Jim Gibson wrote:
On Jan 18, 2015, at 9:03 AM, Mike wrote:
I was able to find match extraction in the perldoc.
Here is a snippet of what I have.
my $insult = ( $mech->text =~ m/Insulter\ (.*)\ Taken/ );
print "$insult\n";
But $insult is being popula
> On Jan 18, 2015, at 9:03 AM, Mike wrote:
>
> I was able to find match extraction in the perldoc.
>
> Here is a snippet of what I have.
>
> my $insult = ( $mech->text =~ m/Insulter\ (.*)\ Taken/ );
> print "$insult\n";
>
> But $insult is being populated with: 1
>
> It should be populated wi
I was able to find match extraction in the perldoc.
Here is a snippet of what I have.
my $insult = ( $mech->text =~ m/Insulter\ (.*)\ Taken/ );
print "$insult\n";
But $insult is being populated with: 1
It should be populated with text. Can anyone tell me what I'm doing
wrong here?
Thanks.
On Sun, 18 Jan 2015 11:49:11 -0500
Mike wrote:
> Hey everyone, I'm trying to find information on how I can use regular
> expressions to populate a variable.
>
> I want to pull text between one set of characters and another set of
> characters and use that to populate my variable. Can anyone po
Hey everyone, I'm trying to find information on how I can use regular
expressions to populate a variable.
I want to pull text between one set of characters and another set of
characters and use that to populate my variable. Can anyone point me in
the right direction?
Thanks.
--
To unsubscri
sday, April 11, 2007 4:30:58 PM (GMT+0200) Auto-Detected
Subject: Using regular expressions with delimitaters
Hello,
I need to use the delimiter " " , (one blank space).
I read perdoc, i try to use this :
if ( "8.1.8" =~ /[\d $versao \s]/)
But the expression is always true.
Wh
On 4/11/07, Rodrigo Tavares <[EMAIL PROTECTED]> wrote:
snip
if ( "8.1.8" =~ /$version/)
snip
You are using the operators incorrectly. It should look like this:
if ($version =~ /8\.1\.8/)
The form is "variable binding_operator regex". Note that the periods
need to be escaped otherwise they w
From: Rodrigo Tavares [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 11, 2007 9:31 AM
To: beginners@perl.org
Subject: Using regular expressions with delimitaters
Hello,
I need to use the delimiter " " , (one blank space).
I read perdoc, i try to use this :
if ( "8.1.8"
Hello,
I need to use the delimiter " " , (one blank space).
I read perdoc, i try to use this :
if ( "8.1.8" =~ /[\d $versao \s]/)
But the expression is always true.
Where is the error ?
my code :
#!/usr/bin/perl
$version=`/usr/local/pgsql/bin/pg_ctl --version`;
print $version;
if ( "8.1.8" =
On 5/3/05, Ing. Branislav Gerzo wrote:
>
> CD>my $address = '[EMAIL PROTECTED]';
> CD>my ( $domain = $address ) =~ m/@(.*)/;
>
> uff, I think you write this in hurry, this simply won't work.
For completeness, you really should write what *will* work. Here's a
correct version:
my $add
Chris Devers [CD], on Tuesday, May 3, 2005 at 10:58 (-0400 (EDT))
thoughtfully wrote the following:
>> I use BayesIt in The Bat, works well.
CD> Is it written in Perl ?
I don't think so :)
CD> Part of the reason I suggested SpamAssassin -- aside from it being an
CD> effective tool in its own rig
On Tue, 3 May 2005, Ing. Branislav Gerzo wrote:
> Chris Devers [CD], on Tuesday, May 3, 2005 at 10:16 (-0400 (EDT))
> typed:
>
> CD>my $address = '[EMAIL PROTECTED]';
> CD>my ( $domain = $address ) =~ m/@(.*)/;
>
> uff, I think you write this in hurry, this simply won't work.
Sorry, ye
Chris Devers [CD], on Tuesday, May 3, 2005 at 10:16 (-0400 (EDT))
typed:
CD>my $address = '[EMAIL PROTECTED]';
CD>my ( $domain = $address ) =~ m/@(.*)/;
uff, I think you write this in hurry, this simply won't work.
You have already declared $address so it will make exception, and
also wi
On Tue, 3 May 2005, gavin mc auley wrote:
> I am new to perl and regular expressions. I am trying to write a
> simple spam filter.
There's your first mistake! :-)
This is a slippery slope.
Your simple filter isn't going to be as effective as you want, so you'll
want to tweak it. The second d
gavin mc auley [gma], on Tuesday, May 03, 2005 at 15:03 (+0100) has on
mind:
gma> is [EMAIL PROTECTED], I want to extract hotmail.com. This is
here is 2 ways how to do that:
(my $domain = '[EMAIL PROTECTED]') =~ s/[EMAIL PROTECTED]@//;
or
my $domain = $1 if '[EMAIL PROTECTED]' =~ /@(.*)/;
there
I am new to perl and regular expressions. I am trying to write a simple spam
filter. for part of this program I want to extract all characters after the @
character. i.e. if the email is [EMAIL PROTECTED], I want to extract
hotmail.com. This is probably a simple task but I am having a problem ac
[ Please do not top-post. TIA ]
[ Please trim your posts. ( excess message trimmed ) TIA ]
Michael Kraus wrote:
John,
Lighten up matey...
The examples I've given are just that examples... Error checking
functionality is up the end programmer... (And you are quite right, you
should check the statu
> -Original Message-
> From: Michael Kraus [mailto:[EMAIL PROTECTED]
> Sent: Thursday, 25 November 2004 11:27 AM
> To: John W. Krahn; Perl Beginners
> Subject: Spam:RE: Spam:Re: Using regular expressions
>
> John,
>
> Lighten up matey...
>
> The exampl
[ Please do not quote the whole message you are responding to, but only
what's needed to give context. Also, please type your reply *below* the
part(s) of the message you are commenting on. ]
Michael Kraus wrote:
John W. Krahn wrote:
You should *always* verify that the files were opened correctl
November 2004 11:17 AM
> To: Perl Beginners
> Subject: Spam:Re: Using regular expressions
>
> Michael S. E. Kraus wrote:
> > G'day...
>
> Hello,
>
> > On Wed, 2004-11-24 at 23:10, FlashMX wrote:
> >
> >>To be able to do a grep on a file via a
Michael S. E. Kraus wrote:
G'day...
Hello,
On Wed, 2004-11-24 at 23:10, FlashMX wrote:
To be able to do a grep on a file via a perl script do you have to
read the whole file in before performing the search and replace?
I've been hearing that reading the whole file in takes up
memory and if multipl
Michael S. E. Kraus wrote:
G'day...
Hello,
On Wed, 2004-11-24 at 23:00, FlashMX wrote:
Could you give an example of using grep on a array to do a replace?
grep example:
if (grep(/bazza/i, @myarray)) {
print "Bazza's home!\n";
}
OR
my @bazza_list = grep {/bazza/i} @myarray;
(Either form is
G'day...
On Wed, 2004-11-24 at 23:00, FlashMX wrote:
> Could you give an example of using grep on a array to do a replace?
grep example:
if (grep(/bazza/i, @myarray)) {
print "Bazza's home!\n";
}
OR
my @bazza_list = grep {/bazza/i} @myarray;
(Either form is fine)
However to do a repl
G'day...
On Wed, 2004-11-24 at 23:10, FlashMX wrote:
> To be able to do a grep on a file via a perl script do you have to read the
> whole file in before performing the search and replace? I've been hearing
> that reading the whole file in takes up
> memory and if multiple users are running the
To be able to do a grep on a file via a perl script do you have to read the
whole file in before performing the search and replace? I've been hearing that
reading the whole file in takes up
memory and if multiple users are running the script then you better have alot
of swap and memory.
Is thi
Could you give an example of using grep on a array to do a replace?
On Wed, 24 Nov 2004 10:05:39 +0530, Prasanna Kothari wrote:
>Hi,
>Replace
>$output = ~ s/AAA*?BBBt/AAA 111 *?222 BBB/g;
>with
>my $output =~ s/AAA*?BBBt/AAA 111 *?222 BBB/g;
>
>You can use "perl -c " which will show you such ty
Hi,
Replace
$output = ~ s/AAA*?BBBt/AAA 111 *?222 BBB/g;
with
my $output =~ s/AAA*?BBBt/AAA 111 *?222 BBB/g;
You can use "perl -c " which will show you such type of errors.
After opening the output file, it's better to check if the file is
opened successfully(as done in the case of INPUT).
I thin
Hi,
The code below opens a file and writes the contents to a temporary file. I need
to do a search and replace of certain matches in the files and I thought I
might be able to use regular
expressions.
Being new to perl and now trying expressions has almost put me over the edge.
When I run the
"John W. Krahn" wrote:
>
> Jon Hans wrote:
> >
> > #ugly
> >if ( defined $frequency{$datalist[$first]} &&
> > defined $frequency{$datalist[$first+1]} &&
> > $frequency{$datalist[$first+2]} &&
> > $frequency{$datalist[$first+3]} &&
> > $frequency{$datalist[$first+4]} &&
> > $frequency{$datalis
Jon Hans wrote:
>
> #!/usr/bin/perl
> ###
>
> I am trying to find all of the reoccurring sequences
> excluding the sub sequences.
>
> Maybe I am missing the obvious, but having a little
> perl exposure and not being an expert perl programmer
>
#!/usr/bin/perl
###
I am trying to find all of the reoccurring sequences
excluding the sub sequences.
Maybe I am missing the obvious, but having a little
perl exposure and not being an expert perl programmer
I have hacked together some code tha
32 matches
Mail list logo