On Fri, Oct 25, 2002 at 09:05:16AM -0700, bioinfo Gu wrote:

> Hello, I want to input a string which is used to create file name on
> unix. and I want to allow input string to consist of  letters(A-Z, or
> a-z) and numbers(0-9) and underscroe( _ ) within file name.
> 
> Does anoybody know how to check the input string legal or not?
> 
> $input = "some string here";
> 
> if ($input =~ /what pattern here/) then { it is legal}
> 
> else {not legal};

if ($input =~ /\W/)
{
    not legal
}
else
{
    legal
}

> Thank you very much.

Make sure you understand what's happening, because it's probably too
important to take my word for it.

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to