Regular expression

2005-09-15 Thread Wong, Danny H.
Hi Perl Gurus,
I have a regular expression question.
I have a variable
$Number = 1.2.3.4

When I use the variable $Number as part of my regular expression, the
. character gets interpret as any character. How do I make it a
literal . that I'm searching for?  
Example:
$String = This is a numeric string 1.2.3.411 embedded within another
string 3.4.5.6
$String =~ m/$Number/I; This returns 1.2.3.411 true, when it
shouldn't.

Thanks for your help!

Thanks 
Danny Wong 
SCM Engineer 
PowerTV Inc., 


- - - - - - - Appended by PowerTV, A division of Scientific Atlanta. - - - - - 
- - 
This e-mail and any attachments may contain information that is confidential, 
proprietary, privileged or otherwise protected by law. The information is 
solely intended for the named addressee (or a person responsible for delivering 
it to the addressee). If you are not the intended recipient of this message, 
you are not authorized to read, print, retain, copy or disseminate this message 
or any part of it. If you have received this e-mail in error, please notify the 
sender immediately by return e-mail and delete it from your computer.

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Regular expression

2005-09-15 Thread Foo Ji-Haw
Don't know if this works, but have you tried:

$string = 1\\.2\\.3;

- Original Message - 
From: Wong, Danny H. [EMAIL PROTECTED]
To: Sisyphus [EMAIL PROTECTED]; Jan Dubois
[EMAIL PROTECTED]; perl-win32-users
perl-win32-users@listserv.ActiveState.com
Sent: Thursday, September 15, 2005 2:28 PM
Subject: Regular expression


 Hi Perl Gurus,
 I have a regular expression question.
 I have a variable
 $Number = 1.2.3.4

 When I use the variable $Number as part of my regular expression, the
 . character gets interpret as any character. How do I make it a
 literal . that I'm searching for?
 Example:
 $String = This is a numeric string 1.2.3.411 embedded within another
 string 3.4.5.6
 $String =~ m/$Number/I; This returns 1.2.3.411 true, when it
 shouldn't.

 Thanks for your help!

 Thanks
 Danny Wong
 SCM Engineer
 PowerTV Inc.,


 - - - - - - - Appended by PowerTV, A division of Scientific
Atlanta. - - - - - - -
 This e-mail and any attachments may contain information that is
confidential, proprietary, privileged or otherwise protected by law. The
information is solely intended for the named addressee (or a person
responsible for delivering it to the addressee). If you are not the intended
recipient of this message, you are not authorized to read, print, retain,
copy or disseminate this message or any part of it. If you have received
this e-mail in error, please notify the sender immediately by return e-mail
and delete it from your computer.

 ___
 Perl-Win32-Users mailing list
 Perl-Win32-Users@listserv.ActiveState.com
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Regular expression

2005-09-15 Thread Сергей Черниенко
Hello Danny,

Thursday, September 15, 2005, 9:28:44 AM, You wrote:

WDH $Number = 1.2.3.4

WDH When I use the variable $Number as part of my regular expression, the
WDH . character gets interpret as any character. How do I make it a
WDH literal . that I'm searching for?  
WDH Example:
WDH $String = This is a numeric string 1.2.3.411 embedded within another
WDH string 3.4.5.6
WDH $String =~ m/$Number/I; This returns 1.2.3.411 true, when it
WDH shouldn't.

 If You mean that '1.2.3.4' is a word i.e. has whitespaces before and
 after it, than your pattern have to be

 $String =~ /$Number\b/;

 That match ' 1.2.3.4 ' and do not match '1.2.3.411'. Dots in $Number
 do not affect matching because variable substituted as string. And
 note: 'i' modifier MUST be lowercase.
-- 
Best regards,
 Сергейmailto:[EMAIL PROTECTED]


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Regular expression

2005-09-15 Thread $Bill Luebkert
Wong, Danny H. wrote:

 Hi Perl Gurus,
   I have a regular expression question.
 I have a variable
 $Number = 1.2.3.4
 
 When I use the variable $Number as part of my regular expression, the
 . character gets interpret as any character. How do I make it a
 literal . that I'm searching for?  
 Example:
 $String = This is a numeric string 1.2.3.411 embedded within another
 string 3.4.5.6
 $String =~ m/$Number/I; This returns 1.2.3.411 true, when it
 shouldn't.

Easiest way is
$String =~ m/\Q$Number\E/i;

You can also use quotemeta (look it up) or escape your .'s in $number (ie: 
1\.2\.3\.4).

PS:  It's not good etiquette to CC people who already read the list.
-- 
  ,-/-  __  _  _ $Bill LuebkertMailto:[EMAIL PROTECTED]
 (_/   /  )// //   DBE CollectiblesMailto:[EMAIL PROTECTED]
  / ) /--  o // //  Castle of Medieval Myth  Magic http://www.todbe.com/
-/-' /___/__/_/_http://dbecoll.tripod.com/ (My Perl/Lakers stuff)
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Regular expression

2005-09-15 Thread $Bill Luebkert
$Bill Luebkert wrote:

 You can also use quotemeta (look it up) or escape your .'s in $number (ie: 
 1\.2\.3\.4).

That should have been '1\.2\.3\.4' or 1\\.2\\.3\\.4.

-- 
  ,-/-  __  _  _ $Bill LuebkertMailto:[EMAIL PROTECTED]
 (_/   /  )// //   DBE CollectiblesMailto:[EMAIL PROTECTED]
  / ) /--  o // //  Castle of Medieval Myth  Magic http://www.todbe.com/
-/-' /___/__/_/_http://dbecoll.tripod.com/ (My Perl/Lakers stuff)
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Doubt in using Win32:GUITest module

2005-09-15 Thread Rajesh Vattem

Hi all,
I am trying to use this Win32:GUITest module for doing some GUI operations.
I observed that the script below fails when I execute the script as below.
perl auto.pl
Strangely, the script passes when I do auto.pl.

Can some one explain why is this so?

my $name = ^Utrantestmanager; 
my $class = undef;  
my @win = FindWindowLike(0, $name, $class); 
show_window($win[0]);

sub show_window
{
print STDOUT In show_window;
my $showtemp = shift;
#using gui.pm in built function for maximising and activating test manager
window
ShowWindow($showtemp, SW_SHOW);
}

Thanks  Regards,
Rajesh.



**
The information contained in this email and any attachments
is likely to be confidential and legally privileged, and is for the
intended recipient named above only. Any copying, 
dissemination, disclosure of or use of this email or its 
attachments unless authorised by us is prohibited, except 
that you may forward this email and/or attachments to a third 
party on a strict need to know basis. 

If you have received this email in error, please notify us 
immediately by replying to the email or by calling 
+91-80-22297030. Please then delete this email and any full
or partial copies of it.

You as the intended recipient must be aware and accept 
that emailis not a totally secure communications medium.

Although we have taken all reasonable steps to make 
sure this email and any attachments are free from viruses, 
we do not (to the extent permitted by law) accept any liability 
whatsoever for any virus infection and/or compromise of 
security caused by this email and any attachment.

No contract may be formed or documents served by you 
on or with us by this email or any attachments unless 
expressly agreed otherwise by us. 

Any views expressed in this email or attachments by 
an individual are not necessarily those of UbiNetics 
India (Private) Limited.

**

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


regex expression to determine if i have a valid email!!

2005-09-15 Thread bruce
hi...

i've got a php app, and i'm trying to figure out how/where to turn to to get
a good working regex in order to determine if i have a valid email address

any help/thoughts/etc.. would be seriously helpful...

i've come across a great many preg_match functions for php, but i haven't
run across one that works all the time!!

i finally figured that someone here, might have the exact soln to my prob!


thanks

-bruce
[EMAIL PROTECTED]


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: regex expression to determine if i have a valid email!!

2005-09-15 Thread Charles K. Clarkson
bruce  wrote:

: i've got a php app, and i'm trying to figure out how/where to
: turn to to get a good working regex in order to determine if i
: have a valid email address 
: 
: any help/thoughts/etc.. would be seriously helpful...
: 
: i've come across a great many preg_match functions for php, but
: i haven't run across one that works all the time!!

I think this works if you remove comments from the address
first. Email will probably screw it up. Search google for it.

(?:(?:\r\n)?[ \t])*(?:(?:(?:[^()@,;:\\.\[\] \000-\031]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\[()@,;:\\.\[\]]))|(?:[^\\r\\]|\\.|(?:(?:\r\n)?[
\t]))*(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()@,;:\\.\[\]
\000-\031]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\[()@,;:\\.\[\]]))|(?:[^\\r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\.(?:(?:\r\n)?[ \t])*(?:[^()@,;:\\.\[\]
\000-\031]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\[()@,;:\\.\[\]]))|(?:[^\\r\\]|\\.|(?:(?:\r\n)?[
\t]))*(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()@,;:\\.\[\]
\000-\031]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\[()@,;:\\.\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[
\t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()@,;:\\.\[\]
\000-\031]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\[()@,;:\\.\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[
\t])*))*\(?:(?:\r\n)?[ \t])*)(?:,\s*(?:(?:[^()@,;:\\.\[\]
\000-\031]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\[()@,;:\\.\[\]]))|(?:[^\\r\\]|\\.|(?:(?:\r\n)?[
\t]))*(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()@,;:\\.\[\]
\000-\031]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\[()@,;:\\.\[\]]))|(?:[^\\r\\]|\\.|(?:(?:\r\n)?[
\t]))*(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()@,;:\\.\[\]
\000-\031]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\[()@,;:\\.\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[

Re: regex expression to determine if i have a valid email!!

2005-09-15 Thread Chris Wagner
Well it very much depends on what u consider a valid email address.
Because technically, anything can be valid in some context.  What u probably
want here is a fully qualified Internet mail address.  The basic form of
this would be m/[EMAIL PROTECTED]/.  If u want to limit that to known
legitimate MX's u can do DNS lookups on the domain part.

At 08:23 PM 9/15/05 -0700, [EMAIL PROTECTED] wrote:
hi...

i've got a php app, and i'm trying to figure out how/where to turn to to get
a good working regex in order to determine if i have a valid email address

any help/thoughts/etc.. would be seriously helpful...

i've come across a great many preg_match functions for php, but i haven't
run across one that works all the time!!

i finally figured that someone here, might have the exact soln to my prob!







--
REMEMBER THE WORLD TRADE CENTER ---= WTC 911 =--
...ne cede malis

0100

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs