-Original Message-
One of the columns I'm calling out of my database is the email one. I'ts in
MAPI format, so I need to extract the very last part. So the bottom example
I would need to grab
JDoe
MAPI:{Doe, John}EX:/o=Company/ou=Site/cn=Recipients/cn=JDoe
Then I can append the res
You can get that plus some other info with this regex:
$string = 'MAPI:{Doe, John}EX:/o=Company/ou=Site/cn=Recipients/cn=JDoe';
($lastname, $firstname, $mailid) = $string =~ m/^.+?\{(\w+),
(\w+)\}.+?cn\=(\w+)$/;
At 09:46 PM 2/8/05 +, steve silvers wrote:
>One of the columns I'm calling out o
From: [EMAIL PROTECTED] <> wrote:
: One of the columns I'm calling out of my database is the email
: one. I'ts in MAPI format, so I need to extract the very last
: part. So the bottom example I would need to grab
:
: JDoe
:
: MAPI:{Doe, John}EX:/o=Company/ou=Site/cn=Recipients/cn=JDoe
:
:
: Th
-Original Message-
> One of the columns I'm calling out of my database is the email one. I'ts
in MAPI format,
> so I need to extract the very last part. So the bottom example I would
need to grab
>
> JDoe
>
> MAPI:{Doe, John}EX:/o=Company/ou=Site/cn=Recipients/cn=JDoe
Steve,
An easy way
n others, but lets remember that we is all brothers in alms with
>our won common
>language - Perl ; )
>
>Flame at will!
>
>-Original Message-
>From: Ron Grabowski [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, June 12, 2002 2:16 AM
>To: [EMAIL PROTECTED]
>Subject
lets remember that we is all brothers in alms with
our won common
language - Perl ; )
Flame at will!
-Original Message-
From: Ron Grabowski [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 2:16 AM
To: [EMAIL PROTECTED]
Subject: Re: Regular Expression Help
> >phone numbe
:
$query->('areacode') =~ m/\d{3}/g;
I want to make sure that there is only 3 digits, not two, or four.
Steve.
>From: "Stephen J Martin" <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: "steve silvers" <[EMAIL PROTECTED]>
>CC: [EMAIL PROTEC
There is the example from the Camel book for putting in commas,
1 while s/(\d)(\d\d\d)(?!\d)/$1,$2/;
which can easily be modified from three and comma, to two and a space:
1 while s/(\d)(\d\d)(?!\d)/$1 $2/;
Which also leaves odd ones on the left. The previous solution put them on
the right.
On Mon, 10 Jun 2002 10:29:28
Arms, Mike wrote:
>>PS I have learned something from this post, I didn't know you could
>>define a string using brackets as you have done...
>
>Except that what you learned:
>
> $a = (12345678904539);
>
>is a bad practise. It is a novice mistake. What is being don
On Mon, 10 Jun 2002 11:38:29
Rubinow, Larry wrote:
>Jim Angstadt wrote:
>
>> produces:
>> * 12 34 56 71 23 4*
>> *12 34 56 71 234*
>> *12 34 56 71 23 4*
>>
>> * 12 34 56 71 23 45*
>> *12 34 56 71 23 45*
>> *12 34 56 71 23 45 *
>>
>> * 12 34 5
Jim Angstadt wrote:
> When I run this snippet below, using the three
> approaches from others, there are three slightly
> different results. See results at end.
>
> Please note spaces at start and end of some results.
> Also, note results with a number of odd length.
>
> Perhaps the differen
--- Stephen J Martin <[EMAIL PROTECTED]> wrote:
> On Mon, 10 Jun 2002 09:10:05
> Joseph Youngquist wrote:
> >This worked for me,
> >$a = 12345678904539;
> >@numbers = split(/(\d{2})/, $a);
> >$NewA = join(' ', @numbers);
> >print "\nNew A: $NewA";
>
> >-Original Message-
> >From:
>
$a = (abc);
# this is an error!
--
Mike Arms
-Original Message-
From: Stephen J Martin [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 10, 2002 8:51 AM
To: steve silvers
Cc: [EMAIL PROTECTED]
Subject: Re: Regular Expression Help
On Mon, 10 Jun 2002 13:38:52
steve silvers wrote:
>How can
On Mon, 10 Jun 2002 13:38:52
steve silvers wrote:
>How can I put a white space between every second number.
>
>I have $a = (12345678904539);
>I want 12 34 56 78 90 45 39
>
>I'm trying
>
>$a =~ s/\\d[2*]/ /g; #This obviously dosen't work :-(
>
>Also how can I tell if there are 3,4, or 5 digits.
On Mon, 10 Jun 2002 09:10:05
Joseph Youngquist wrote:
>This worked for me,
>$a = 12345678904539;
>@numbers = split(/(\d{2})/, $a);
>$NewA = join(' ', @numbers);
>print "\nNew A: $NewA";
>-Original Message-
>From: [EMAIL PROTECTED]
>[mailto:[EMAIL PROTECTED]]On Behalf Of
>steve silver
Joseph Youngquist wrote:
> This worked for me,
>
> $a = 12345678904539;
>
> @numbers = split(/(\d{2})/, $a);
>
> $NewA = join(' ', @numbers);
>
> print "\nNew A: $NewA";
Or, more simply, s/(\d\d)(?=\d\d)/$1 /g;
___
Perl-Win32-Users mailing list
[
This worked for me,
$a = 12345678904539;
@numbers = split(/(\d{2})/, $a);
$NewA = join(' ', @numbers);
print "\nNew A: $NewA";
hth,
Joe Y.
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
steve silvers
Sent: Monday, June 10, 2002 8:39 AM
To: [EMAIL
On Sat, 1 Dec 2001, linkagent wrote:
> - Original Message -
> From: "$Bill Luebkert" <[EMAIL PROTECTED]>
> To: "linkagent" <[EMAIL PROTECTED]>
> > linkagent wrote:
> > > I need members help on this;
> > > Q1)As far as I know, \d* means match either 0 or more digits, since
> > > /(\d*)
linkagent wrote:
>
> Correct me if I am wrong;
> Therefore am I right to say that the matching sequence starts from the back
> first (which is not what I read from the books about matching / /).
>
> i.e in the following match /(\d*)(\d{4})(\d{5})$/
> the regexes look for $ first;
> then followe
linkagent <[EMAIL PROTECTED]> wrote:
> Correct me if I am wrong;
> Therefore am I right to say that the matching sequence starts
> from the back first (which is not what I read from the books
> about matching / /).
No, the matcher starts from the front, but when it fails it
backtracks to see if
On Sat, 1 Dec 2001, linkagent wrote:
> - Original Message -
> From: "$Bill Luebkert" <[EMAIL PROTECTED]>
> To: "linkagent" <[EMAIL PROTECTED]>
> > linkagent wrote:
> > > I need members help on this;
> > > Q1)As far as I know, \d* means match either 0 or more digits, since
> > > /(\d*)
- Original Message -
From: "$Bill Luebkert" <[EMAIL PROTECTED]>
To: "linkagent" <[EMAIL PROTECTED]>
> linkagent wrote:
> > I need members help on this;
> > Q1)As far as I know, \d* means match either 0 or more digits, since
> > /(\d*)/ match 1006326869812 , therefore
> > I could not se
linkagent wrote:
> - Original Message -
> From: "Ron Hartikka" <[EMAIL PROTECTED]>
>
>>for $number (1006326869812, 563296853235993 , 35968322963568389){
>>print "$1-$2-$3\n" if ($number =~ /(\d*)(\d{4})(\d{5})/);
>>
>
> I need members help on this;
> Q1)As far as I know, \d* means m
- Original Message -
From: "Ron Hartikka" <[EMAIL PROTECTED]>
> for $number (1006326869812, 563296853235993 , 35968322963568389){
> print "$1-$2-$3\n" if ($number =~ /(\d*)(\d{4})(\d{5})/);
I need members help on this;
Q1)As far as I know, \d* means match either 0 or more digits, sinc
Thanks to all those who responded
Rob
-Original Message-
From: Plane, Robert
Sent: Thursday, November 29, 2001 3:32 PM
To: '[EMAIL PROTECTED]'
Subject: Regular expression help
I need help creating a regular expression to do the following.
I have the following numbers:
1006326869812
<[EMAIL PROTECTED]> wrote:
> I need help creating a regular expression to do the following.
>
> I have the following numbers:
>
> 1006326869812
> 563296853235993
> 35968322963568389
>
> and it needs to be broken up like this
>
> 1006-3268-69812
> 563296-8532-35993
> 35968322-9635-68389
>
> Notice
How about something like
s/(\d+)(\d{4})(\d{5})/$1-$2-$3/
?
--- [EMAIL PROTECTED] wrote:
> I need help creating a regular expression to do the
> following.
>
> I have the following numbers:
>
> 1006326869812
> 563296853235993
> 35968322963568389
>
> and it needs to be broken up like this
>
> 1
Here is a start:
if the needs to numeric and the format stated, then change the
s/^(\d+)(\d{4})(\d{5})$/$1-$2-$3/ to
if ( s/^(\d+)(\d{4})(\d{5})$/$1-$2-$3/ ) {
}else {
#error of sometype
}
#!perl -w
while ( ) {
chomp;
s/^(\d+)(\d{4})(\d
You don't even need a regex although you could use one...
# untested
my $num = 92739874598745;
$num =~ /^(\d*)(d{4})(\d{5})$/;
my ($n1, $n2, $n3) = ($1, $2, $3);
Or you could do this...
# untested
my $num = 92739874598745;
my $n1 = substr($num, 0, length($num) - 9);
my $n2 = substr($num, -9, 4
[EMAIL PROTECTED] wrote:
> I need help creating a regular expression to do the following.
>
> I have the following numbers:
>
> 1006326869812
> 563296853235993
> 35968322963568389
>
> and it needs to be broken up like this
>
> 1006-3268-69812
> 563296-8532-35993
> 35968322-9635-68389
>
> Not
for $number (1006326869812, 563296853235993 , 35968322963568389){
print "$1-$2-$3\n" if ($number =~ /(\d*)(\d{4})(\d{5})/);
}
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of
> [EMAIL PROTECTED]
> Sent: Thursday, November 29, 2001 3:32 PM
>
31 matches
Mail list logo