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 to translate it to a
regular
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,
--- "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
25 matches
Mail list logo