URL BNF search part does not make sense

Posted by Asaf Mesika on Stack Overflow See other posts from Stack Overflow or by Asaf Mesika
Published on 2010-04-14T13:10:19Z Indexed on 2010/04/14 13:13 UTC
Read the original article Hit count: 522

Filed under:
|
|

Hi,

While implementing a Java regular expression for URL based on the URL BNF published by W3C, I've failed to understand the search part. As quoted:

httpaddress             h t t p :   / / hostport [  / path ] [ ?
                         search ]   
search                  xalphas [ + search ]   
xalphas                 xalpha [ xalphas ]   
xalpha                  alpha | digit | safe | extra | escape   
alpha                   a | b | c | d | e | f | g | h | i | j | k |
                         l | m | n | o  | p | q | r | s | t | u | v |
                         w | x | y | z | A | B | C  | D | E | F | G |
                         H | I | J | K | L | M | N | O | P |  Q | R |
digit                   0 |1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9   
safe                    $ | - | _ | @ | . | &  | + | - 
extra                  ! | * |  " |  ' | ( | )  | , 

Search claims it is xalphas seperated by a plus sign. xalphas can contain plus signs by it self, as claimed by safe. Thus according to my understanding , it should be:

search     xalphas

Where am I wrong here?

© Stack Overflow or respective owner

Related posts about url

Related posts about bnf