> my $date =~ s#(\d{2})(\d{2})(\d{4})#$1/$2/$3#;
That amazingly, doesn't have much performance loss to it.
I just did:
sub build_list_news {
my $newstext = "";
my %news = get_news();
foreach (keys %news) {
$news{$_}{ctime} =~
s#(\d{4})(\d{2})(\d{2})(\d{2})
In article <[EMAIL PROTECTED]>, Sara wrote:
> $TS = "THIS INPUT IS IN ALL CAPS";
>
> $TS_cont = lc $TS;
>
> $TS now prints out "this input is in all caps"
>
> What If I want first letter in caps for every word in string? which should
> be "This Input Is In All Caps"
>
> TIA,
>
> Sara.
perldo
On Wednesday, Jul 23, 2003, at 09:58 US/Pacific, Sara wrote:
$TS = "THIS INPUT IS IN ALL CAPS";
$TS_cont = lc $TS;
$TS now prints out "this input is in all caps"
What If I want first letter in caps for every word in string? which
should be "This Input Is In All Caps"
a way of solving this woul
".
>
> $TS =~ s/(\w+)/ucfirst lc $1/ge;
>
> Scott
>
> -Original Message-
> From: Sara [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, July 23, 2003 12:59 PM
> To: org
> Subject: Another Regex question.
>
>
> $TS = "THIS INPUT IS IN ALL CA
other Regex question.
$TS = "THIS INPUT IS IN ALL CAPS";
$TS_cont = lc $TS;
$TS now prints out "this input is in all caps"
What If I want first letter in caps for every word in string? which should
be "This Input Is In All Caps"
TIA,
Sara.
--
To unsubsc
On Wed, 23 Jul 2003 21:58:52 +0500, "Sara" <[EMAIL PROTECTED]> wrote:
> $TS = "THIS INPUT IS IN ALL CAPS";
>
> $TS_cont = lc $TS;
>
> $TS now prints out "this input is in all caps"
>
> What If I want first letter in caps for every word in string
ww.mawebcenters.com/insite2000
-Original Message-
From: Sara [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 23, 2003 11:59 AM
To: org
Subject: Another Regex question.
$TS = "THIS INPUT IS IN ALL CAPS";
$TS_cont = lc $TS;
$TS now prints out "this input is in all caps"
Wha
Sara,
You can use "ucfirst".
$TS =~ s/(\w+)/ucfirst lc $1/ge;
Scott
-Original Message-
From: Sara [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 23, 2003 12:59 PM
To: org
Subject: Another Regex question.
$TS = "THIS INPUT IS IN ALL CAPS";
$TS_cont = lc $TS;
$TS = "THIS INPUT IS IN ALL CAPS";
$TS_cont = lc $TS;
$TS now prints out "this input is in all caps"
What If I want first letter in caps for every word in string? which should be "This
Input Is In All Caps"
TIA,
Sara.
(/(\d{2})(\d{2})(\d{4})/);
-Original Message-
From: Scot Robnett [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 02, 2003 2:03 PM
To: Paul Kraus; Sara; [EMAIL PROTECTED]
Subject: RE: Regex question.
> > 2- Want to format dates like birth = 02151956 should be 02/15/1956
> m
> > 2- Want to format dates like birth = 02151956 should be 02/15/1956
> my $date = "$1/$2/$3/" if (/(\d\d)(\d\d)(\d\d\d\d)/)
# All of this is UNTESTED, please treat as such.
# More of "the same but different"
my $date = qq($1/$2/$3) if /(\d{2})(\d{2})(\d{4})/;
# Takes into account dates lik
> 1- Remove all the leading 000 from any field like acct# = 00037839842
> should be 37939842 and Post# should be 1980
s/^0+//;
>
> 2- Want to format dates like birth = 02151956 should be 02/15/1956
my $date = "$1/$2/$3/" if (/(\d\d)(\d\d)(\d\d\d\d)/)
HTH
Paul Kraus
--
To unsubscribe, e-mail
1-
my $number =~ s/^0*(\d+)/$1/
that should trim the leading 0's
2-
my $date =~ s#(\d{2})(\d{2})(\d{4})#$1/$2/$3#;
i use #'s as delimaters here... some other character may be more appropriate
At 07:49 AM 6/26/2003 -0700, Sara wrote:
I have a database with the following fields.
lname fnam M
acct
I have a database with the following fields.
lname fnam M acct# mrmbirth Postdate Post# drln
drfn m disch
DOE,JOHN,R,00037839842,207337,02151956,04072003,01980,LastName,FirstName,L,04102003
I have a very simple script which splits the delimiter , and sh
Andrew,
Thanks for trying to help.
Scot
-Original Message-
From: Andrew Brosnan [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 29, 2003 3:05 PM
To: Scot Robnett; [EMAIL PROTECTED]
Subject: RE: Another regex question
Try this:
#!/usr/bin/perl
#File:
use warnings;
use strict;
#set
Try this:
#!/usr/bin/perl
#File:
use warnings;
use strict;
#set slurp mode
undef $/;
my $stuff_i_want;
while () {#read in your file
#match up to Today's Headlines (or whatever)
if (/Today's Headlines:<\/strong>/) {
$stuff_i_want = $'; #put the rest in $stuff_i_want
}
..
-Original Message-
From: Andrew Brosnan [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 29, 2003 1:45 PM
To: Scot Robnett; [EMAIL PROTECTED]
Subject: RE: Another regex question
On 5/29/03 at 12:27 PM, [EMAIL PROTECTED] (Scot Robnett) wrote:
Will the file always be formated as below (wi
On 5/29/03 at 12:27 PM, [EMAIL PROTECTED] (Scot Robnett) wrote:
Will the file always be formated as below (with the blank line between
articles)? If so you could set the record separator '$/' to paragraph
mode to read each of them in:
# $/; #default is newline
# $/ = ""; # paragraph mode
I read perlfaq6. Several times, in fact, and specifically the section you're
pointing out. I'm one of those people who needs a good beating to understand
something, but once I "get it" I don't forget...just not there yet.
I basically want to extract the first several lines of the file, maybe to
di
On 5/29/03 at 11:22 AM, [EMAIL PROTECTED] (Scot Robnett) wrote:
> Okay,
>
> I've looked at perlre, perlretut, perldoc.com, Learning Perl, and a
> partridge in a pear tree, and I'm still stupid. :)
>
> Does anyone out there have a working example script that does
> matching over multiple lines, p
Okay,
I've looked at perlre, perlretut, perldoc.com, Learning Perl, and a
partridge in a pear tree, and I'm still stupid. :)
Does anyone out there have a working example script that does matching over
multiple lines, preferably an HTML file? I'm just having a lot of difficulty
with this and it wo
> "Scot" == Scot Robnett <[EMAIL PROTECTED]> writes:
Scot> Hey y'all, I got over my brain cramp and thought I'd share with the group in
Scot> case it helps anyone trying to do something similar. I was making it way too
Scot> complicated. All I needed was:
Scot> if($email !~ /\w+@\w+\.\w{2,4}
Scot Robnett wrote:
> I don't think you can check for the existence of an e-mail address without
> actually attempting to send mail to it. You can ping or traceroute a domain,
> but only the mail server associated with it knows if the username is valid
> or not. If this is wrong, somebody with in
I don't think you can check for the existence of an e-mail address without
actually attempting to send mail to it. You can ping or traceroute a domain,
but only the mail server associated with it knows if the username is valid
or not. If this is wrong, somebody with information please reply to the
At 10-3-2002 09:36 -0500, fliptop wrote:
>>Hey y'all, I got over my brain cramp and thought I'd share with the group in
>>case it helps anyone trying to do something similar. I was making it way too
>>complicated. All I needed was:
>>if($email !~ /\w+@\w+\.\w{2,4}/)
>>{
>> # error stuff here
>>}
Scot Robnett wrote:
> Hey y'all, I got over my brain cramp and thought I'd share with the group in
> case it helps anyone trying to do something similar. I was making it way too
> complicated. All I needed was:
>
> if($email !~ /\w+@\w+\.\w{2,4}/)
> {
> # error stuff here
> }
have you conside
On 3/9/02 1:46 PM, Scot Robnett <[EMAIL PROTECTED]> wrote:
Hi Scot,
> I'm trying to do a simple verification of an e-mail address format. I want
> to require:
>
> - 1 or more alphanumeric characters
> - followed by "@"
> - followed by 1 or more alphanumerics
> - followed by a dot
> - followed b
ons
[EMAIL PROTECTED]
http://www.insiteful.tv
-Original Message-
From: Scot Robnett [mailto:[EMAIL PROTECTED]]
Sent: Saturday, March 09, 2002 3:47 PM
To: [EMAIL PROTECTED]
Subject: Regex question
I'm trying to do a simple verification of an e-mail address format. I want
to require:
I'm trying to do a simple verification of an e-mail address format. I want
to require:
- 1 or more alphanumeric characters
- followed by "@"
- followed by 1 or more alphanumerics
- followed by a dot
- followed by 2-4 alphanumerics.
(for example, .
How you get the data? From a CGI-FORM? or STDIN?
Suppose you get the data from a string format...
I will do in this way..
$value_list =~ s/,/COMMA/eg;
@data = split(/,/, $value_list);
... expressions.
... expressions.
... expressions.
($d0_value0, d0_$value1, $d0_value2) = split(/CO
On Fri, 15 Jun 2001, Robert Watterson <[EMAIL PROTECTED]> wrote,
> Hi all,
>
> I have a line that has each field separated by commas. However, some of
> individual fields are double quoted strings and also have embedded commas in
> them. for example:
>
> Value1,"Value2, blah,blah,blah",Value3,"V
Robert Watterson wrote:
: I have a line that has each field separated by commas. However, some of
: individual fields are double quoted strings and also have embedded commas in
: them.
The Text::CSV_XS module will handle this.
-- tdk
Hi all,
I have a line that has each field separated by commas. However, some of
individual fields are double quoted strings and also have embedded commas in
them. for example:
Value1,"Value2, blah,blah,blah",Value3,"Value4,blah",Value5
When I use the split function using the split pattern of /
> Or better, how do I learn to use regex?
You have to read "Mastering Regular Expressions" if you wanna
be an expert, but you don't have to if all you want is to start
studying regexes. There are much simpler ways :
1) "Learning Perl" has a chapter about regular expressions
2) perldoc perlre
A
--- Bruno Veldeman <[EMAIL PROTECTED]> wrote:
> I have a string with this format "/blabla/dir/nextdir/name.txt"
> I want only 'name.txt' in one string and the rest in another string.
my $string = '/blabla/dir/nextdir/name.txt';
my ( $path, $file ) = ( $string=~ m!^(.*/)(.*)$! );
Breaking dow
re of them
# $/ == endofline
- Roger -
- Original Message -
From: "Bruno Veldeman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, June 09, 2001 9:07 PM
Subject: Regex question
> Hi,
>
> I can't seem to get the regex right for this:
>
> I
MAIL PROTECTED]]
Sent: June 09, 2001 16:08
To: [EMAIL PROTECTED]
Subject: Regex question
Hi,
I can't seem to get the regex right for this:
I have a string with this format "/blabla/dir/nextdir/name.txt"
I want only 'name.txt' in one string and the rest in another string.
Bruno Veldeman wrote:
>
> I have a string with this format "/blabla/dir/nextdir/name.txt"
> I want only 'name.txt' in one string and the rest in another string.
in this case, i would use split:
$location = "/blabla/dir/nextdir/name.txt";
@dirs = split("\/", $location);
foreach (@dirs) { print
Hi,
I can't seem to get the regex right for this:
I have a string with this format "/blabla/dir/nextdir/name.txt"
I want only 'name.txt' in one string and the rest in another string.
It would be nice explaining the regex in plain english.
Or better, how do I learn to use regex?
For now i
39 matches
Mail list logo