<div dir="ltr">Thanks for you answer sir,<br>I was thinking its regular expressions(automata) not BNF grammer. Aint I right ?<br><br>And I thought even if it is for human reading, if we write literal grammer ( regular expression, in my view) using documentation, we would end up with python not allowing strings like"python's rule" and ' python"the master" '<br>
<br>Here I changed the defination of string literal for explaining my thinking, inserted short-singlequoted-stringitem, short-sq-tstringchar, short-doublequoted-stringitem and short-dq-stringchar . I think we should use this in documentation<br>
<div><br>stringliteral ::= [stringprefix](shortstring | longstring)<br>stringprefix ::= "r" | "u" | "ur" | "R" | "U" | "UR" | "Ur" | "uR"<br>
| "b" | "B" | "br" | "Br" | "bR" | "BR"<br>shortstring ::= "'" short-singlequoted-stringitem* "'" | '"' short-doublequoted-stringitem* '"'<br>
longstring ::= "'''" longstringitem* "'''"<br> | '"""' longstringitem* '"""'<br>short-singlequoted-stringitem ::= short-sq-stringchar | escapeseq<br>
short-doublequoted-stringitem ::= short-dq-stringchar | escapeseq<br>longstringitem ::= longstringchar | escapeseq<br>short-sq-tstringchar ::= <any source character except "\" or newline or single-quote><br>
short-dq-stringchar ::= <any source character except "\" or newline or double-quote><br>longstringchar ::= <any source character except "\"><br>escapeseq ::= "\" <any ASCII character><br>
</div></div>