For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > January 2006 > regular expression









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author regular expression
Krishna Thotakura

2006-01-10, 4:02 am

I am looking for help on a PERL regular expression that can do the
following:

1. Make sure that the string is 20 chars or else match should fail.
2. The string can have word characters or spaces or comma(,), hyphen(-),
ampersand(&) characters.
3. If the string contains only spaces, then match should fail.

Any ideas on how this can be done using just one regular expression ?


Thanks.

****************************************
*********************************
This communication, including attachments, is
for the exclusive use of addressee and may contain proprietary,
confidential and/or privileged information. If you are not the intended
recipient, any use, copying, disclosure, dissemination or distribution is
strictly prohibited. If you are not the intended recipient, please notify
the sender immediately by return e-mail, delete this communication and
destroy all copies.
****************************************
*********************************


Charles K. Clarkson

2006-01-10, 4:02 am

Krishna.Thotakura@hartfordlife.com <> wrote:

: Any ideas on how this can be done using just one regular
: expression ?

I'm curious, why one regex? Is this for a non-perl
application?


Charles K. Clarkson
--
Mobile Homes Specialist
254 968-8328




Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com