On 2012-12-22 10:46, Feng He wrote:
You probably had $string double quoted instead of
single quoted which later results in the \ being eaten.
Thank you. The people who said the problem of double quoted string are correct,
I didn't know this item before.
This is what I really want:
use s
>
> You probably had $string double quoted instead of
> single quoted which later results in the \ being eaten.
>
Thank you. The people who said the problem of double quoted string are correct,
I didn't know this item before.
This is what I really want:
use strict;
my $email1 = restore_email
On Thu, Dec 20, 2012 at 11:39 PM, Feng He wrote:
> Hello,
>
> I have a string like: dns\.support.dnsbed.com
> I want to translate it to a regular email address: dns.supp...@dnsbed.com
>
>
> if ($string =~ /^(.*?)(? my $user = $1;
> my $tld = $2;
> return $user . '@'. $t
Hi,
On Fri, Dec 21, 2012 at 8:39 AM, Feng He wrote:
> Hello,
>
> I have a string like: dns\.support.dnsbed.com
> I want to translate it to a regular email address: dns.supp...@dnsbed.com
>
>
> if ($string =~ /^(.*?)(? my $user = $1;
> my $tld = $2;
> return $user . '@
Shaji Kalidasan*
To: Feng He
Cc: "beginners@perl.org"
Sent: Friday, 21 December 2012 3:55 PM
Subject: Re: Help with a regex
Greetings,
IMHO, Here is one way to do it. Again there could be better ways to solve this
one.
while () {
if(/
([\w.]+) #Match foo.bar | jack.f
it is your gift back to God.
---
From: Feng He
To: *Shaji Kalidasan*
Cc: "beginners@perl.org"
Sent: Friday, 21 December 2012 3:31 PM
Subject: Re: Help with a regex
The ema
ift back to God.
---
From: Guoke Zhou (Wicresoft)
To: Feng He
Cc: "beginners@perl.org"
Sent: Friday, 21 December 2012 2:01 PM
Subject: RE: Help with a regex
$string='dns\.support.dnsbed.com'
$string='dns\.support.dnsbed.com';
print "$string\n";
if ($string =~ /^(.*?)\\\.(.*?)(?mailto:fen...@nsbeta.info]
Sent: Friday, December 21, 2012 3:39 PM
To: beginners@perl.org
Subject: Help with a regex
Hello,
I have a string like: dns\.support.dnsbed.com I want
Hello,
I have a string like: dns\.support.dnsbed.com
I want to translate it to a regular email address: dns.supp...@dnsbed.com
if ($string =~ /^(.*?)(?http://learn.perl.org/
2009/7/18 Jenn G. :
> next if /\/0$|^127\./;
>
> ( the regex means when meet something like 192.168.1.0/0 or 127.0.0.1
> it will be next.)
When you say, "it will be next" it sounds like you want it to be
processed. The next keyword stops this loop iteration short, and
continues at the next iterati
Jenn G. wrote:
Hello,
Hello,
I'm not sure if the syntax below is correct:
next if /\/0$|^127\./;
( the regex means when meet something like 192.168.1.0/0 or 127.0.0.1
it will be next.)
Or do I need to use () to enclose the char at both sides of the "|" ?
next if /(\/0$)|(^127\.)/;
No,
Hello,
I'm not sure if the syntax below is correct:
next if /\/0$|^127\./;
( the regex means when meet something like 192.168.1.0/0 or 127.0.0.1
it will be next.)
Or do I need to use () to enclose the char at both sides of the "|" ?
next if /(\/0$)|(^127\.)/;
Please help, thanks!
Regards.
--- "R. Joseph Newton" <[EMAIL PROTECTED]> wrote:
> Stuart White wrote:
> I don't think so:
>
...
> The only place a colon split splits is where you
> have a colon.
>
That was MY typo. Oops. In the book there is a colon
after merlyn, not a question mark. Irrespective of
that, I was still
--- "R. Joseph Newton" <[EMAIL PROTECTED]> wrote:
> Stuart White wrote:
>
>
> > the file format is not sloppy at all. I was just
> > confused as to why I couldn't use split on the
> first
> > space score comma and space, and then the next
> space
> > score. <-Perhaps I just answered my questio
Stuart White wrote:
> the file format is not sloppy at all. I was just
> confused as to why I couldn't use split on the first
> space score comma and space, and then the next space
> score. <-Perhaps I just answered my question right
> there, seeing that in the second iteration, there is
> no c
Stuart White wrote:
> $line =
> "merlyn::118:10:Randal:/home/merlyn?/usr/bin/perl";
> @fields = s;oit(/:/,$line);
> #now @fields is ("merlyn:,
> "","118","10","Randal","/home/merlyn","/usr/bin/perl")
I don't think so:
Greetings! E:\d_drive\perlStuff>perl -w
$line =
"merlyn::118:10:Randal:/ho
--- Paul Johnson <[EMAIL PROTECTED]> wrote:
>
> Stuart White said:
>
> > I'm not sure what's going wrong here. Can someone
> > tell me how I can split 'Spurs 94, Suns 82' into:
> > array[0] == 'Spurs' and array[1] == 'Suns'
>
> @array = /([[:alpha:]]+)/g;
>
This did what I wanted it to do, t
--- "R. Joseph Newton" <[EMAIL PROTECTED]> wrote:
> Stuart White wrote:
>
> > Wow, yeah that helps a lot.
> > Here's a question: If if had:
> > $line = 'Spurs 94, Suns 82, Heat 99, Magic 74'
> > and then did a split on comma and comma's
> surrounding
> > spaces:
> > @result = split (/\s*,\s*/, $
Stuart White wrote:
> Wow, yeah that helps a lot.
> Here's a question: If if had:
> $line = 'Spurs 94, Suns 82, Heat 99, Magic 74'
> and then did a split on comma and comma's surrounding
> spaces:
> @result = split (/\s*,\s*/, $line);
result? How specific is "result" to the issue at hand? Woul
--- "Randy W. Sims" <[EMAIL PROTECTED]>
wrote:
> On 03/12/04 08:18, Stuart White wrote:
> > I like the idea of using split() but decided to
> keep
> > most of my regex and incorporate split on the
> string.
> > So the string: 'Spurs 94, Suns 82' <-and there may
> or
> > may not be a space after th
On 03/12/04 08:18, Stuart White wrote:
I like the idea of using split() but decided to keep
most of my regex and incorporate split on the string.
So the string: 'Spurs 94, Suns 82' <-and there may or
may not be a space after the 2.
I decided to read up on split(), and then try to split
it.
The spli
Stuart White said:
> I'm not sure what's going wrong here. Can someone
> tell me how I can split 'Spurs 94, Suns 82' into:
> array[0] == 'Spurs' and array[1] == 'Suns'
@array = /([[:alpha:]]+)/g;
--
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net
--
To unsubscribe, e-mail: [EMAIL PROT
I like the idea of using split() but decided to keep
most of my regex and incorporate split on the string.
So the string: 'Spurs 94, Suns 82' <-and there may or
may not be a space after the 2.
I decided to read up on split(), and then try to split
it.
This is what I came up with:
@teamscores = spl
Oops, it just looked like you were testing a literal.
My mistake, I'll check it out.
--- "Randy W. Sims" <[EMAIL PROTECTED]>
wrote:
> On 3/11/2004 10:28 PM, Stuart White wrote:
>
> > --- "Randy W. Sims" <[EMAIL PROTECTED]>
> > wrote:
> >
> >>On 3/11/2004 9:01 PM, Stuart White wrote:
> >>
> >>
On 3/11/2004 10:28 PM, Stuart White wrote:
--- "Randy W. Sims" <[EMAIL PROTECTED]>
wrote:
On 3/11/2004 9:01 PM, Stuart White wrote:
I'm confused about greediness.
This is the line that I'm trying to match:
Spurs 94, Suns 82
If the line is as above, I probably wouldn't use a
regex. The following
--- "Randy W. Sims" <[EMAIL PROTECTED]>
wrote:
> On 3/11/2004 9:01 PM, Stuart White wrote:
>
> > I'm confused about greediness.
> > This is the line that I'm trying to match:
> >
> > Spurs 94, Suns 82
>
> If the line is as above, I probably wouldn't use a
> regex. The following
> is more verbo
On 3/11/2004 9:01 PM, Stuart White wrote:
I'm confused about greediness.
This is the line that I'm trying to match:
Spurs 94, Suns 82
If the line is as above, I probably wouldn't use a regex. The following
is more verbose, but easier to manage IMHO.
#!/usr/bin/perl
use strict;
use warnings;
my
I'm confused about greediness.
This is the line that I'm trying to match:
Spurs 94, Suns 82
This is my regex:
if ($_
=~/(Spurs|Suns|Mavericks|Lakers|Clippers|Cavaliers|Celtics|Pacers|Pistons|Wizards|Warriors|Bulls|Hawks|Raptors|Magic|Heat|Kings|Rockets|Nuggets|Grizzlies|Jazz|Knicks|Nets|Supersoni
[EMAIL PROTECTED] wrote:
> Thanks Jeff. I hope to try this out later today. I thought I had the
> solution earlier this morning, but I ran into a problem. I hope this will
> solve it ! Thanks again.
>
> >apples San Antonio Fruit
> >oranges Sacramento Fruit
> >pineappl
TED]
To
[EMAIL PROTECTED]
cc
[EMAIL PROTECTED]
Subject
Re: Need help with a regex
On Jan 23, [EMAIL PROTECTED] said:
>This newbie needs help with a regex. Here's what the data from a text
>file looks like. There's no delimiter and the fields aren't evenly spaced
&g
On Jan 23, [EMAIL PROTECTED] said:
>This newbie needs help with a regex. Here's what the data from a text
>file looks like. There's no delimiter and the fields aren't evenly spaced
>apart.
>
>apples San Antonio Fruit
>oranges Sacramento
The bottom line is that I
really appreciate your help.
"Tim Johnson" <[EMAIL PROTECTED]>
01/23/2004 01:32 AM
To
"Tim Johnson" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>,
<[EMAIL PROTECTED]>
cc
Subject
RE: Need help with a regex
Ooh. That
etween the two outside spaces.
-Original Message-
From: Tim Johnson
Sent: Thu 1/22/2004 9:31 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Cc:
Subject: RE: Need help with a regex
Try this o
On Fri, Jan 23, 2004 at 12:01:13AM -0500, [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote:
> This newbie needs help with a regex. Here's what the data from a text
> file looks like. There's no delimiter and the fields aren't evenly spaced
> apart.
>
> apples
--Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thu 1/22/2004 9:01 PM
To: [EMAIL PROTECTED]
Cc:
Subject: Need help with a regex
This newbie needs help with a regex. Here's what the data from
This newbie needs help with a regex. Here's what the data from a text
file looks like. There's no delimiter and the fields aren't evenly spaced
apart.
apples San Antonio Fruit
oranges Sacramento Fruit
pineapples Honolulu Fruit
lemons
36 matches
Mail list logo