• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A Question on Schema example from w3schools.

 
Satish Avadhanam
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's correct.
 
Satish Avadhanam
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Lasse.
 
Vidya Ravi
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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?
 
Hari Vignesh Padmanaban
Ranch Hand
Posts: 578
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic