Lyle Kopnicky wrote:
Craig Cardimon wrote:
I'm looking for patterns where the sign "%" or the word "percent" are
preceded by a group of one or more digits and zero or more spaces.
if( $line =~ /\%|\bpercent\b/i )
{
if( $line =~ /\d+\s*(\%|\bpercent\b/i )
{
# magic happens
Craig Cardimon wrote:
I'm looking for patterns where the sign "%" or the word "percent" are
preceded by a group of one or more digits and zero or more spaces.
if( $line =~ /\%|\bpercent\b/i )
{
if( $line =~ /\d+\s*(\%|\bpercent\b/i )
{
# magic happens
}
}
The outer if is re
I'm looking for patterns where the sign "%" or the word "percent" are
preceded by a group of one or more digits and zero or more spaces.
if( $line =~ /\%|\bpercent\b/i )
{
if( $line =~ /\d+\s*(\%|\bpercent\b/i )
{
# magic happens
}
}
Am I on the right track here? In the tex
Ok I figured it out. The eval has to output a legal argument for print().
The previous version didn't work because print $x $y is invalid. U need
print "$x $y".
$x = "a";
$y = "b";
$z = '$x $y';
print eval "\"$z\"";
##
a b
--
REMEMBER THE WORLD TRADE CENTER ---=< WTC 911
Jim Hill wrote:
> $Bill Luebkert wrote:
>
>>The eval already suggested by Chris should work
>
> It doesn't, unfortunately, unless I'm mishandling it in some way.
Try this one:
use strict;
use warnings;
my %ini;
my $inifile = 'test.ini';
make_ini ($inifile);
read_ini ($inifile);
print Data::
At 01:07 PM 3/2/2006 +, Jim Hill wrote:
>> I would try print eval $ini{section}{match}.
>
>Sorry, I should have mentioned that I've tried that ...
Desperation time. ;)
$x = "a";
$y = "b";
$z = '$x $y';
($m1, $m2) = $z =~ m/\$(.+)\s\$(.+)/;
print "$$m1 $$m2";
##
a b
--
REMEMBER TH
Thomas, Mark - BLS CTR in
<[EMAIL PROTECTED]>:
> > > > > Jim Hill wrote:
> > > > >
> > > > > > | $ini{section}{match} = '$1 $2';
> > > > > > ... however that just prints "$1 $2" as a literal string.
> > > > >
> > > > > Hint: the above two lines of your post answer your own question.
> > >
> > >
> Thomas, Mark in
> <[EMAIL PROTECTED]>:
> > > From: Jim Hill [mailto:[EMAIL PROTECTED]
> > > Thomas, Mark in
> <[EMAIL PROTECTED]>:
> > > > Jim Hill wrote:
> > > >
> > > > > | $ini{section}{match} = '$1 $2';
> > > > > ... however that just prints "$1 $2" as a literal string.
> > > >
> > > > Hi
Jim Hill wrote:
> | $ini{section}{match} = '$1 $2';
> ... however that just prints "$1 $2" as a literal string.
Hint: the above two lines of your post answer your own question.
:-)
- Mark.
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.A
Thomas, Mark in
<[EMAIL PROTECTED]>:
> Jim Hill wrote:
>
> > | $ini{section}{match} = '$1 $2';
> > ... however that just prints "$1 $2" as a literal string.
>
> Hint: the above two lines of your post answer your own question.
Do they? That doesn't help me, I'm afraid. I've been struggling
with t
Thomas, Mark - BLS CTR in
<[EMAIL PROTECTED]>:
> Glad you got it... I didn't realize you *wanted* the '$1 $2' to be
> *stored* as a literal string.
There's the rub, neither did I.
--
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveS
$Bill Luebkert wrote:
> Jim Hill in <[EMAIL PROTECTED]>:
>
> > I have a log analysis script to which I'm trying to add a pattern
> > matching option. [snip]
>
> The eval already suggested by Chris should work
It doesn't, unfortunately, unless I'm m
Thomas, Mark in
<[EMAIL PROTECTED]>:
> > From: Jim Hill [mailto:[EMAIL PROTECTED]
> > Thomas, Mark in <[EMAIL PROTECTED]>:
> > > Jim Hill wrote:
> > >
> > > > | $ini{section}{match} = '$1 $2';
> > > > ... however that just prints "$1 $2" as a literal string.
> > >
> > > Hint: the above two lines
Chris Wagner in <[EMAIL PROTECTED]>:
> At 12:07 AM 3/2/2006 +, perl-win32-users@listserv.ActiveState.com wrote:
> > | print $ini{section}{match};
> >
> >... however that just prints "$1 $2" as a literal string.
>
> I would try print eval $ini{section}{match}.
Sorry, I should have mentioned t
At 12:07 AM 3/2/2006 +, perl-win32-users@listserv.ActiveState.com wrote:
>| print $ini{section}{match};
>
>... however that just prints "$1 $2" as a literal string.
I would try print eval $ini{section}{match}.
--
REMEMBER THE WORLD TRADE CENTER ---=< WTC 911 >=--
"...ne cede malis
Hi all
I have a log analysis script to which I'm trying to add a pattern
matching option. The script is controlled via the contents of an
inifile, for example ...
[exception]
title=ERROR: exceptions
extract=C000 .* EXCEPTION
regex=^.*? (..:..:..) .*? \((.*?)\) .*
match=$1 $2
... whic
Hello,
Use the module File::Basename.
regards,
Reinhard
Maxmelbin Neson (RBIN/EDM3) wrote:
Pattern matching problem
Hello ,
Please find the explanation of
my problem below
This is a part of a script which
should execute in both Windows and Unix ..
Based on the
Maxmelbin Neson (RBIN/EDM3) wrote:
>
> Hello ,
>
> Please find the explanation of my problem below
>
> This is a part of a script which should execute in both Windows and Unix ..
>
> Based on the OS the following variables are set
>
> If Windows $slash = "\\" and If Unix $slash = "/"
>
> Pa
Title: Pattern matching problem
Hello ,
Please find the explanation of my problem below
This is a part of a script which should execute in both Windows and Unix ..
Based on the OS the following variables are set
If Windows $slash = "\\" and If Unix $slash = "/"
Craig Cardimon wrote, on Friday, July 30, 2004 11:36 AM
: To: [EMAIL PROTECTED];
: [EMAIL PROTECTED]
: Subject: pattern matching problem
:
:
: I am searching text files for the keyword Exhibit or Form followed by a
: number, a decimal, and any number of letter or numbers within
I am searching text files for the keyword Exhibit or Form followed by a
number, a decimal, and any number of letter or numbers within
parentheses or not.
For example:
Exhibit 12
Exhibit 12.1
Exhibit 12(a)
Exhibit 12.1(a)
Exhibit 12.1(2)
Exhibit 12.1(a)(b)
Exhibit 12.1(1)(2)
Exhibit 12 (a)
Exhibi
-Original Message-
From: Nick Djurovich [mailto:nick_djurovich@;aimtechnology.com]
Sent: Thursday, November 14, 2002 5:17 PM
To: Ricci, Mark; [EMAIL PROTECTED]
Subject: RE: Pattern matching
Hi Mark,
Looking at the important part of the string ;
/search q=court reporting [...]
You
On Wed, 25 Sep 2002, Erich C. Beyrent wrote:
> Hey everyone,
>
> I am trying to do some really tricky pattern matching and replacement (well,
> tricky for me...), and it looks like this:
>
> find this string in a file: #colwidth[@pageindex]
> replace with this string: #gri
Balam,
You say your code is not working, but you don't say what's wrong.
You could try Date::Manip. It may be overkill, of course, and you don't get
a Perl date out of Parse_Date; you still need to run it through Unix_Date
with the %s format qualifier. And I always seem to have to hold my tongu
On Wed, 27 Feb 2002 [EMAIL PROTECTED] wrote:
> Why should greedy pattern matching be avoided.
>
> my e.g: here
>
> $_ = "bambam";
>
> #option1.
> print if /.*?m/ ;
> print "\n";
>
> #option2.
> p
On Wed, 27 Feb 2002 [EMAIL PROTECTED] wrote:
> Why should greedy pattern matching be avoided.
>
> my e.g: here
>
> $_ = "bambam";
>
> #option1.
> print if /.*?m/ ;
> print "\n";
>
> #option2.
> p
curiosity, what application outputs this type of datafile?
Peter Guzis
Web Administrator, Sr.
ENCAD, Inc.
email: [EMAIL PROTECTED]
www.encad.com
-Original Message-
From: Greg Wardawy [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 27, 2001 10:07 AM
To: [EMAIL PROTECTED]
email: [EMAIL PROTECTED]
www.encad.com
-Original Message-
From: Greg Wardawy [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 27, 2001 10:07 AM
To: [EMAIL PROTECTED]
Subject: Repeated pattern matching
Hello all,
To extract data from the following text:
-snip-
The SDQ line can have up to 10
ot; if $sdq15 > 0;
print "$sdq17,$upc,$price,$sdq18\n" if $sdq17 > 0;
print "$sdq19,$upc,$price,$sdq20\n" if $sdq19 > 0;
print "$sdq21,$upc,$price,$sdq22\n" if $sdq21 > 0;
}
The SDQ line can have up to 10 pairs store/quantity ($sdq+odd num
29 matches
Mail list logo