Re: How to test for 2 words from a list in a form field?

2011-04-09 Thread shawn wilson
On Sun, Apr 10, 2011 at 12:27 AM, Brian F. Yulga wrote: > shawn wilson wrote: >> >> On Sat, Apr 9, 2011 at 3:29 PM,  wrote: >> >>> my $address_count = () = $str =~ /box|street|avenue|lane|apo/ig; >> >> what does print $var = () = $str =~ /regex/; do? >> particularly the '= () ='? >> > > Accor

Re: What's the best IDE in windows 7 for a beginner aiming at using Bioperl?

2011-04-09 Thread roofer
As others have already pointed out - Padre is a very nice IDE. For quick work (one not requiring an "IDE"), I like Vim (GVim), Notepad++, and gedit on Windows. I must admit that gedit is a tad slow on the uptake, so really I would recommend Notepad++ for a newer user and Vim for someone that h

Re: Select equivalent in perl

2011-04-09 Thread Tim Maher
On Thu, Apr 07, 2011 at 11:26:10AM -0700, Jim Gibson wrote: > On 4/7/11 Thu Apr 7, 2011 10:48 AM, "Balaji krishnan" > scribbled: > > > Hi folks > > > > I have been using shell script for my admin work and recently decided to use > > perl fo all my automation. So proud I did that. > > > > Quic

Re: REGEX Explanation

2011-04-09 Thread Dr.Ruud
On 2011-04-08 14:34, Shawn H Corey wrote: my @words = split /\s+/, $string; See perldoc -f split, about why you might want to write that as my @words = split ' ', $string; To get it to not capture any matches, use the non-capture parentheses: @num = split /(?:(?:a|b)+)/, $x; Does tha

Re: How to test for 2 words from a list in a form field?

2011-04-09 Thread Brian F. Yulga
Brian F. Yulga wrote: my @mail_types = qw( avenue road box lane ); my @words = split /\s/, $fields; my $count = grep { my $found; foreach my $street ( @mail_types ) { if ( /\b$street\b/i ) { $found++; last; } } $found; } @words; print qq(fo

Re: How to test for 2 words from a list in a form field?

2011-04-09 Thread Brian F. Yulga
shawn wilson wrote: On Sat, Apr 9, 2011 at 3:29 PM, wrote: my $address_count = () = $str =~ /box|street|avenue|lane|apo/ig; what does print $var = () = $str =~ /regex/; do? particularly the '= () ='? According to "Effective Perl Programming (2nd Ed.)", Item 9 (Know the dif

Re: How to test for 2 words from a list in a form field?

2011-04-09 Thread John W. Krahn
shawn wilson wrote: On Sat, Apr 9, 2011 at 3:29 PM, wrote: It is detecting but not testing if any particular 2 words are in a text field and I think that's what you explained you were testing for. Sorry if my first post was misleading. Those were just some examples. I'm looking o

Re: How to test for 2 words from a list in a form field?

2011-04-09 Thread shawn wilson
On Sat, Apr 9, 2011 at 3:29 PM, wrote: > Hi Chris, > >> It is detecting but not testing if any particular 2 words are in a >> text field and I think that's what you explained you were testing for. > >        Sorry if my first post was misleading.  Those were just some examples. >  I'm looking on

Re: regular expression for email id and IP address

2011-04-09 Thread Rob Dixon
On 09/04/2011 21:30, Olof Johansson wrote: On 2011-04-10 01:40 +0530, Sunita Rani Pradhan wrote: You are right. Thanks for pointing out. Can you help me getting it correct ? Somebody already mentioned Regex::Common. Use the same module for email addresses: use Regexp::Common qw/ net Emai

Re: trouble matching words with parentheses using grep

2011-04-09 Thread John W. Krahn
Mariano Loza Coll wrote: Hello everyone, Hello, Here's what I need to do: I need to take each of the words in one List1, search for their presence (or not) in a second List2 and make a new list with all the words in both. These are lists of gene names, which can often include numbers and symb

Re: regular expression for email id and IP address

2011-04-09 Thread Olof Johansson
On 2011-04-10 01:40 +0530, Sunita Rani Pradhan wrote: > Hi Johan s/Johan/Olof/, but who keeps score? > You are right. Thanks for pointing out . Can you help me > getting it correct ? Somebody already mentioned Regex::Common. -- - Olof Johansson - www: http://www.stdlib.se/ -

Re: trouble matching words with parentheses using grep

2011-04-09 Thread Alan Haggai Alavi
Hello Mariano, use List::MoreUtils qw( any each_array ); I was experimenting and forgot to take off `each_array` from the import list. `each_array` is not used in the alternative solution and is hence not required. Regards, Alan Haggai Alavi. -- The difference makes the difference -- To uns

RE: regular expression for email id and IP address

2011-04-09 Thread Sunita Rani Pradhan
Hi Johan You are right. Thanks for pointing out . Can you help me getting it correct ? Thanks Sunita -Original Message- From: Olof Johansson [mailto:o...@ethup.se] Sent: Sunday, April 10, 2011 12:13 AM To: beginners@perl.org Subject: Re: regular expression for email id and IP

Re: trouble matching words with parentheses using grep

2011-04-09 Thread Alan Haggai Alavi
Hello Mariano, I realize that there may be a number of ways to do what I need to do (most of them better, I bet), and I'd love to learn about them. But now I'm mostly curious about why grep// cannot "see" words with parentheses in either (or both lists). I suspect the trick may be somehow escapi

Re: How to test for 2 words from a list in a form field?

2011-04-09 Thread sono-io
Hi Chris, > It is detecting but not testing if any particular 2 words are in a > text field and I think that's what you explained you were testing for. Sorry if my first post was misleading. Those were just some examples. I'm looking only for an occurrence of _any_ two words in that li

trouble matching words with parentheses using grep

2011-04-09 Thread Mariano Loza Coll
Hello everyone, Here's what I need to do: I need to take each of the words in one List1, search for their presence (or not) in a second List2 and make a new list with all the words in both. These are lists of gene names, which can often include numbers and symbols in addition to letters. The very

Re: regular expression for email id and IP address

2011-04-09 Thread Olof Johansson
On 2011-04-09 23:53 +0530, Sunita Rani Pradhan wrote: > Yes it is matching 167.249.0.0 . But it's also matching things like "42". Feature? Read about quantifiers, and also about the precedence of |. -- - Olof Johansson - www: http://www.stdlib.se/ - {mail,xmpp}: o...@ethup.se - ir

Re: regular expression for email id and IP address

2011-04-09 Thread Brian Fraser
use Regexp::Common qw/ net /; $ip =~ /$RE{net}{IPv4}/;

RE: regular expression for email id and IP address

2011-04-09 Thread Sunita Rani Pradhan
Yes it is matching 167.249.0.0 . -Sunita -Original Message- From: Jim Gibson [mailto:jimsgib...@gmail.com] Sent: Saturday, April 09, 2011 11:50 PM To: Perl Beginners Subject: Re: regular expression for email id and IP address At 11:42 PM +0530 4/9/11, Sunita Rani Pradhan wrote: >Hi All >

Re: regular expression for email id and IP address

2011-04-09 Thread Jim Gibson
At 11:42 PM +0530 4/9/11, Sunita Rani Pradhan wrote: Hi All 1. Can anybody guide me to write a regular expression to verify correct Email address ? peldoc -q valid "How do I check a valid mail address?" 2. I have written a regular expression to verify correct

regular expression for email id and IP address

2011-04-09 Thread Sunita Rani Pradhan
Hi All 1. Can anybody guide me to write a regular expression to verify correct Email address ? 2. I have written a regular expression to verify correct IP address : print $ipadd if ($ipadd =~ /^([0-9])|([1-9][0-9])|([1-2][0-5][0-5])\.([0-9])|([1-9][0-9])|([1-2