in reply to A question of logic and syntax

Funny node, I must say.

Did you try to find an answer yourself? Does not really look like it. But I'm in a good mood, and killing time until my wife comes home....

To answer your first question: substr.
Nice, isn't it?

print "'$str' starts with lowercase\n!" if substr($str,0,1) =~ /[a..z] +/;

For the second, where do you live? What kind of phonenumbers will you accept? International?

print "Only -+()0..9 allowed!\n" if $str =~ /[^+-()0..9]/;

/me hopes this helps you learn....

Jeroen
"We are not alone"(FZ)

Replies are listed 'Best First'.
Re: Re: A question of logic and syntax
by blackjudas (Pilgrim) on Apr 27, 2001 at 22:52 UTC
    Thanks for the wit :)

    I was stuck in regex land, looking for a pattern to match the first Uppercase char.

    I must also clarify the telephone number question, I'm looking for a "rulebook" for international numbers so I can compensate for different locations, the NA number format is fairly straight-forward but european countries and others don't seem to conform, ie. in the UK an area code could be one or 4 numbers, depending on location.

    And yes, I'll always be learning... this post was just a "I'm at a loss, and need to ask a fellow perl programmer" I'll admit the answer was simple. And thank you for yours.