• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

A Question on Schema example from w3schools.

 
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's correct.
 
Satish Avadhanam
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Lasse.
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 578
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Space pants. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic