# A Question on Schema example from w3schools.

Ranch Hand
Posts: 697
Hi all
Here is an example from w3schools schema tutorial

I am a little bit confused with description given below the code in w3schools website.

1. aAbBcC
2. aaAbBccC

I think 1 represents the element and not 2.

Guys, I would really appreciate if anyone can correct me incase this is wrong. Thanks.

Lasse Koskela
author
Sheriff
Posts: 11962
5
That's correct.

Ranch Hand
Posts: 697
Thanks Lasse.

Vidya Ravi
Greenhorn
Posts: 14
"The acceptable value is one or more occurrences of a lowercase letter followed by a uppercase letter from a to z.

1. aAbBcC
2. aaAbBccC
"

Okay....i am totally confused. 2 also meet the criteria. So isnt 2 correct?

Ranch Hand
Posts: 578
Originally posted by Vidya Ravi:
"The acceptable value is one or more occurrences of a lowercase letter followed by a uppercase letter from a to z.

1. aAbBcC
2. aaAbBccC
"

Okay....i am totally confused. 2 also meet the criteria. So isnt 2 correct?

I am not an expert at regular expressions

But assuming wht Lasse said is correct,
The expression
"The acceptable value is one or more occurrences of a lowercase letter followed by a uppercase letter from a to z.

means that a lower case letter MUST be followed by an upper case letter NOT a lower case Letter !!!

so aA is correct !!!

but
aa is wrong !!! as it is a lowercase letter followed by a lower case letter !!!

so is aaAbBccC !!!

If u want "aaAbBccC" to be right, i think you ahve to change teh regualr expression !!! My guess is

mabe if the expresion included a "*" like
([a-z]*[A-Z])+

But I am not sure !!! :roll: (any regular expression experts ..please answer )
If i am wrong, please correct me

hope this helps and clears your doubts

Andy Smith
Ranch Hand
Posts: 239
Correct
([a-z]*[A-Z])+

1. [a-z] means any lowercase character.
2. [a-z]* means any lowercase character to appear any no of times (including zero times).
3. [a-z]*[A-Z] means point 2 neccesarily followed by a Uppercase character.
4. + charater makes point 3 to appear atleast once.