Re: regex question

2002-02-11 Thread Edward G. Orton
- 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 Other Client - XYZ > Another Client > > > I need

Re: regex question

2001-10-04 Thread Mick Ghazey
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

RE: regex question

2001-10-04 Thread Lee Goddard
Not sure what you're trying to do, but if you wish to split into strings at the pont ] or \] then just use the split command to split at that string. Put the string in an 'or' block, signified in for perl regex engine as (a|b), where both a and b represent a string, in your case ] and \], though y

Re: regex question...

2001-06-19 Thread Andy McKay
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]

Re: regex question...

2001-06-13 Thread $Bill Luebkert
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

Re: regex question...

2001-06-13 Thread Tim Hammerquist
"$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

RE: regex question...

2001-06-13 Thread Richard A. Evans
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

Re: regex question...

2001-06-13 Thread $Bill Luebkert
"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/\

Re: REGEX question / delete tags

2001-05-13 Thread Ron Grabowski
> $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