Hi folks,
i have a task to verify that word "Bug" is in the table in the 3rd row from
the buttom, i came up with regex , but it doesnt work.
can anyone please take a look?
#/usr/bin/perl -w
my $line =
"\nA\nBug\nC\nD\n";
print "3 matches: $1\n" if ($line =~
/(.+Bug[^()]+<\/tr>)\s*(.+<\/tr>\s+)
thank you for reponse!
unfortunately I have to use regex to solve this problem.
I was trying to simplify:
$file=~/.+Bug.+<\/tr>\s*.+<\/tr>\s*.+?<\/tr>\s*.+?<\/tr>\s*<\/table>/;
still does not work!!!
On 10/12/06, Dr.Ruud <[EMAIL PROTECTED]> wrote:
matches my string "Bug some word" in both file1.txt and
file2.txt, should only match file1.txt
frustrated!
what is wrong here?
thank you!
On 10/13/06, I. B. <[EMAIL PROTECTED]> wrote:
thank you for reponse!
unfortunately I have to use regex to solve this problem.
I was trying
Hi nice people,
how to specify using regular expressions: match everything but string (xxx)
i would do this :
$line =~ /[^(xxx)]+/;
but, as it was mentioned before () inside character class is not working.
what is solution here?
thank you!
~i
got it! very nice, not complicated at all. I didn't know about lookahead
feature. very useful.
this file that should be matched:
row 1
row 2
row 3
Bug some word
row 4
row 5
this is file that should not be matched:
row 1
row 2
row 3
Bug some word
row 4
row 5
row 6
this is soluti
sorry, I didn't fraze my question correctly.
example :
$line="abcxabcxxabcxxxabc";
how to match everything beofre "xxx" but not xxx itself?
the answer i got is to use lookaheads:
my $line = "abcxxabcxxxabc";
if ($line =~ m{(.*?(?:(?!xxx).))xxx}){
print "matched: $1\n";
}
else{
print "f
this community, I found solution using
help of my former colleague
and I posted it here for others interested individuals to see. It is all
about exercising skills. And having fun.
;)
On 14 Oct 2006 10:13:16 -0700, Randal L. Schwartz
wrote:
>>>>> "I" == I B <[
right, what was i thinking?
thank you.
On 10/13/06, John W. Krahn <[EMAIL PROTECTED]> wrote:
I.B. wrote:
> sorry, I didn't fraze my question correctly.
^
phrase
> example :
> $line="abcxabcxxabcxxxabc";
>
> how to match everything beofre "xxx" but not xx
or just:
my $filename="/home/dbsmith/passwd.duby02.linux";
my ($pass,$hostname,$platform)=split /\./, $filename;
~i
On 12/12/06, Lawrence Statton XE2/N1GAK <[EMAIL PROTECTED]> wrote:
If you're dealing with variable length strings, separated by some kind
of character, then regexp is the tool
also keep open and close outside the loop.
you overwriting previously written lines.
open FILE2,"$file";
foreach @lines
{
print FILE2 $_;
}
close FILE2
cheers
On 1/18/07, Mathew <[EMAIL PROTECTED]> wrote:
Thanks. That likely will help. However, I still can't even get it to
perform any action
you can use lookaheads:
my @matched = split /\s+(?=\w+=)/,$string;
cheers,
~i
On 1/19/07, Michael Alipio <[EMAIL PROTECTED]> wrote:
Hi,
Suppose I have:
my $string = 'Jan 19 11:37:21 firewall date=2007-01-19 time=11:42:15
devname=TESTfirewall device_id=FGT-602905503304 log_id=0104032006 ty
[,|\s+] - means one of the following characters: , or | or \s or +
(,|\s+) - means "," or "\s+"
, but yeas alternation will match $2 in :
~ /date=(\S+?)(\s+|,)/;
On 1/19/07, Michael Alipio <[EMAIL PROTECTED]> wrote:
Hi,
I'm a bit confused here:
I have a regexp:
($date) = $log =~ /dat
substitute "\s" with "*" to make split easier sounds like a very bad idea.
didn't see people doing that in perl.
problem is solved, why do you add extra complexity?
On 1/19/07, Michael Alipio <[EMAIL PROTECTED]> wrote:
- Original Message
From: I.B. <[EMAIL PROTECTED]>
To: begginers p
one more to remove spaces selectively:
$string =~ s/(\s+)(?:(?!date=|time=)(?=\w+=))/*/g;
cheers,
~i
On 1/20/07, Mumia W. <[EMAIL PROTECTED]> wrote:
On 01/20/2007 06:46 AM, Michael Alipio wrote:
> Cool
>
> I got this from approximately 71% perldoc perlre:
>
> print "5: got $1\n" if $
Hi people,
I installed module Net::Ftp::Recursive. All following steps succeeded:
perl Makefile.PL
make
make test
make install
# next i tested if module loading correctly
~$ perl -MNet::Ftp::Recursive -e "1;"
Can't locate Net/Ftp/Recursive.pm in @INC (@INC contains: /etc/perl
/usr/local/lib/perl
I will try to reproduce this again. I am sure it was Net::FTP::Recursive
thank you for response
~igy
On 4/24/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Hi,
I think that you have a little mistake
Run perl -MNet::FTP::Recursive -e "1;" instead of perl -MNet::Ftp::Recursive -e
"1;".
Yo
16 matches
Mail list logo