Re: regrex question

2003-03-20 Thread drieux
On Thursday, Mar 20, 2003, at 14:23 US/Pacific, David Gilden wrote: [..] I am trying to get the following as a result: xxx9988 #!/usr/bin/perl -w $card_number = '123456789988'; $card_number =~ s/\d{8}(\d{4})/x'x'8 . $1/e; # not working print "$card_number\n"; I presume when you run that

Re: Trying to block out BGCOLOR

2003-03-20 Thread drieux
On Thursday, Mar 20, 2003, at 11:26 US/Pacific, Kipp, James wrote: I'm saying it could be bgcolor="COLOR" or bgcolor=COLOR Yes I realize. I believe drieux's solution, or an adaptation of it, is what you need note: I do subs because it is easier for me to 'loop on them' and if they are worth it, th

Re: regrex question part 2

2003-03-20 Thread Wiggins d'Anconia
Remember to always group reply so others can help and be helped. David Gilden wrote: Why am I getting 'one two three' in $s and not just 'one' You might want to print $1, this will give you a better idea. $1 is being set to everything in the parentheses, which is everything you match, and the

Re: regrex question part 2

2003-03-20 Thread Wiggins d'Anconia
David Gilden wrote: In the following why am I getting '23' Is 23 being treated as a string? Not exactly. It is NOT being treated as a number if that is what you mean, all of $s is being treated as a string. Specifically \w matches any "word" character, which is any alphanumeric...so [A-Za-z0-9_].

regrex question part 2

2003-03-20 Thread David Gilden
In the following why am I getting '23' Is 23 being treated as a string? #!/usr/bin/perl -w use strict; my $s = ' 23 one two three'; $s =~ s/(\w{1,10}).+/$1/; print $s; --- my $s = 'one two three'; $s =~ s/(\w)/$1/; print $s; Returns 'one two three', I was looking for it to match 'on

regrex question

2003-03-20 Thread David Gilden
good afternoon, I am trying to get the following as a result: xxx9988 #!/usr/bin/perl -w $card_number = '123456789988'; $card_number =~ s/\d{8}(\d{4})/x'x'8 . $1/e; # not working print "$card_number\n"; Is there a clever trick using tr =~ or something similar? Thanks! Dave -- To

RE: Trying to block out BGCOLOR

2003-03-20 Thread Kipp, James
>I'm saying it could be bgcolor="COLOR" or bgcolor=COLOR Yes I realize. I believe drieux's solution, or an adaptation of it, is what you need I would of course go with say: # # sub un_colour {

Re: Trying to block out BGCOLOR

2003-03-20 Thread WilliamGunther
I'm saying it could be bgcolor="COLOR" or bgcolor=COLOR

Re: Trying to block out BGCOLOR

2003-03-20 Thread drieux
On Thursday, Mar 20, 2003, at 06:00 US/Pacific, Kipp, James wrote: I'm making something, and need to block out BGCOLOR attribute. The problem is, the BGCOLOR could be with or without quotation marks. This is the code I used: $article =~ s/ bgcolor=("?)(.*?)("?)//gi so you are saying it could be b

Inserting a Form Feed Using a Format Statement

2003-03-20 Thread Theresa Mullin
Hi everyone, I'm writing what I thought would be a really quick program to print course information across the top of our Course Evaluation forms. I'm using a "format" statement to get the spacing just right on the output, but I can't get it to insert the form feed character at the end. I'

RE: Trying to block out BGCOLOR

2003-03-20 Thread Kipp, James
> > I'm making something, and need to block out BGCOLOR > attribute. The problem > is, the BGCOLOR could be with or without quotation marks. > This is the code I > used: > > $article =~ s/ bgcolor=("?)(.*?)("?)//gi > so you are saying it could be bgcolor or "bgcolor" ? how about something

RE: simple query

2003-03-20 Thread Bob Showalter
mark sony wrote: > Hi > > Can anyone tell me what does $. in perl mean ? > And also anyplace I will get references about these in quick time ie. > a handbook type ? All the special variables are documented in perldoc perlvar $. keeps track of the input line number, similar to awk's NR --

Re: simple query

2003-03-20 Thread WilliamGunther
In a message dated 3/20/2003 12:35:02 AM Eastern Standard Time, [EMAIL PROTECTED] writes: > Hi > > Can anyone tell me what does $. in perl mean ? > And also anyplace I will get references about these in quick time > ie. a handbook type ? > It is an alternitive for $INPUT_LINE_NUMBER. All the