This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

A Question on Schema example from w3schools.  RSS feed

 
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.
 
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.
 
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?
 
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
 
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!