venkatperl55 has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: reg exp
by Corion (Patriarch) on Mar 02, 2010 at 07:59 UTC

    You already got answers in dont consider if (......). Where do you have problems with the answers you got and how does your new post address these?

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: reg exp
by Ratazong (Monsignor) on Mar 02, 2010 at 07:52 UTC

    Your specification seems not to be clear ... however you should try to replace

    next if ($username =~ /ipw\.a^a-ma-z*/);
    by
    next if ($username =~ /ipw\.a[a-m][a-z]*/);
    That way names like "ipw.ammmmawert" would be skipped, but "ipw.anawert" wouldn't.

    HTH, Rata

    PS.: PLEASE work on your formatting!

    update: removed one small ^ (with a big effect)

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: reg exp
by ungalnanban (Pilgrim) on Mar 02, 2010 at 08:54 UTC
    Are you trying for this. see the Example.
    use strict; use warnings; while(1) { my $data=<STDIN>; if($data =~ /ipw\.[ar][a-z][a-z]*/) { print "Match\t\t$data \n"; } else { print "Not Match $data\n"; } }

    We already answered for this question in "dont consider if (......)". First you learn regular expression.
    Refer the following Links.

    http://networking.ringofsaturn.com/Unix/regex.php#Grouping
    http://www.troubleshooters.com/codecorn/littperl/perlreg.htm
    --sugumar--
      Good links, Thanks.
Re: reg exp
by Anonymous Monk on Mar 02, 2010 at 09:04 UTC
    Which spam company do you work for?
    A reply falls below the community's threshold of quality. You may see it by logging in.