tags:

views:

18

answers:

1

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?

+1  A: 

That's pretty clearly a mistake (+ is a reserved delimiter for URIs), but the BNF you're linking to seems to be out of date. Probably best to use the one included at the end of the latest RFC 3986.

ig0774