Prabahar Mosas wrote:
Hai,

Hello,

     I have problem to assign a regular expression
into a variable.  If any one know regarding this
mail me as early as possible. If it is cannot give
me alternative solution.

specimen coding
**************
$value = 2422; $reg = '/\d/';

The slashes (/) are the delimiters for the match operator, they are not a part of the regular expression, just like the quotes (') delimit the string but are not a part of it. Your "regular expression" says match a '/' character followed by a '\d' character followed by a '/' character.


    if ($value =~ $reg) {
       print "Correct Value;
    }   else   {
       print "Check the Value";
    }


John
--
use Perl;
program
fulfillment

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to