Solved.
Thanks to Edward G. Orton
t0by
-Original Message-
From: Edward G. Orton [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 12, 2002 3:15 PM
To: Toby Stuart; [EMAIL PROTECTED]
Subject: Re: regex question
- Original Message -
From: "Toby Stuart" <[EMAIL P
- Original Message -
From: "Toby Stuart" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 11, 2002 10:57 PM
Subject: regex question
> Hi All,
>
> I have the following lines in a file
>
>
> Some Client - ABC - DEF
> Some O
Hi All,
I have the following lines in a file
Some Client - ABC - DEF
Some Other Client - XYZ
Another Client
I need a regex to remove everything after the last dash (-) if one is
present.
I know this is possible i just cannot figure.
I'm about to use split etc. but i know there's a better wa
my @strings = qw( hello\] hi_there] how_are_you2\] fine-and-you\]
good_thanks]);
for(@strings){
my $matched = /(.*)\\*?\]$/;
if( $matched )
{
print "matched! - $1 \n"
}
else
{
print "no match - $1 \n"
}
}
matched! - hello\
matched! - hi_there
matched! - how_are
ostolia (ISS Atlanta)
> Sent: 04 October 2001 17:36
> To: Perl-Win32 (E-mail)
> Subject: regex question
>
>
> hello all,
> I need some help with regex again...
>
> I have a file that looks like this:
>
> hello\]
> hi_there]
> how_are_you2\]
> fine-and-
hello all,
I need some help with regex again...
I have a file that looks like this:
hello\]
hi_there]
how_are_you2\]
fine-and-you\]
good_thanks]
I need my regex to much all these strings above.
The only way now that I can do this is by having 2 regex :
while ( )
{
if( $_ =~ m/(.*)\\\]/
t;
To: "Perl-Win32 (E-mail)" <[EMAIL PROTECTED]>
Sent: Wednesday, June 13, 2001 3:46 PM
Subject: RE: regex question...
> If you really want a 'correct' IP, you could use this:
>
> $ip_addr =~
> /^(([01]?\d\d?|2[0-4]\d|25[0-5])\.){3}([01]?\d\d?|2[0-4]\d|25[0-5]
Tim Hammerquist wrote:
>
> "$Bill Luebkert" wrote:
> >
> > "Schiza, Apostolia (ISS Atlanta)" wrote:
> > >
> > > Hi,
> > > in one of my perl scripts I am trying to check for a valid ip address,
> > > ie in the format of XXX.XXX.XXX.XXX where x of course is digit,
> > > and you can have ips with ea
"$Bill Luebkert" wrote:
>
> "Schiza, Apostolia (ISS Atlanta)" wrote:
> >
> > Hi,
> > in one of my perl scripts I am trying to check for a valid ip address,
> > ie in the format of XXX.XXX.XXX.XXX where x of course is digit,
> > and you can have ips with each feild having 1-3 digits
> > This is th
> Hi,
> in one of my perl scripts I am trying to check for a valid ip address,
> ie in the format of XXX.XXX.XXX.XXX where x of course is digit,
> and you can have ips with each feild having 1-3 digits
> This is the regex I am using:
>
> $ip_addr =~ m/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/
> (I am
If you really want a 'correct' IP, you could use this:
$ip_addr =~
/^(([01]?\d\d?|2[0-4]\d|25[0-5])\.){3}([01]?\d\d?|2[0-4]\d|25[0-5])$/
This RegEx (based on page 124 of "Mastering Regular Expressions", O'Reilly)
forces the numbers to be in the range 0 - 255. There is one, and only one
problem
"Schiza, Apostolia (ISS Atlanta)" wrote:
>
> Hi,
> in one of my perl scripts I am trying to check for a valid ip address,
> ie in the format of XXX.XXX.XXX.XXX where x of course is digit,
> and you can have ips with each feild having 1-3 digits
> This is the regex I am using:
>
> $ip_addr =~ m/\
Hi,
in one of my perl scripts I am trying to check for a valid ip address,
ie in the format of XXX.XXX.XXX.XXX where x of course is digit,
and you can have ips with each feild having 1-3 digits
This is the regex I am using:
$ip_addr =~ m/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/
(I am basically trying
> $parts[2] =~ s/<.?[td|table|tr](.*)>//g;
[] is a character class, you are telling Perl to match a 't' or a 'd' or
a '|' or an 'a', etc.
$parts[2] =~ s/<.?(?:td|table|tr)(.*?)>//g;
Should fix the problem of everything being deleted. I recall there being
a HTML::TableExtract module which you co
hi all,
i have a problem with a table i want to read out.. I have to deleate all the
tag first.
(HTML::Parser or else issnt reading tables, issn't it ? )
so I tryed this
$parts[2] =~ s/<.?[td|table|tr](.*)>//g;
but it kills all !
hm, ??? hoq do i do this ?
greets ven
___
15 matches
Mail list logo