Augmented BNF for Syntax Specifications: ABNF

本文详细解读了RFC5234中关于基本字符集的规定,包括字母、数字、特殊字符等,并提供了相关代码示例。

原文:http://tools.ietf.org/html/rfc5234

Core Rules

Certain basic rules are in uppercase, such as SP,HTAB, CRLF, DIGIT,

   ALPHA, etc.

 

        ALPHA          =  %x41-5A / %x61-7A   ; A-Z / a-z

 

        BIT            =  "0" / "1"

 

        CHAR           = %x01-7F

                                ; any 7-bitUS-ASCII character,

                                ;  excluding NUL

 

 

 

         CR             = %x0D

                                ; carriagereturn

 

        CRLF           =  CR LF

                                ; Internet standardnewline

 

        CTL            =  %x00-1F / %x7F

                                ; controls

 

        DIGIT          =  %x30-39

                                ; 0-9

 

        DQUOTE         =  %x22

                                ; " (Double Quote)

 

        HEXDIG         =  DIGIT / "A" / "B" /"C" / "D" / "E" / "F"

 

        HTAB           =  %x09

                                ; horizontaltab

 

         LF             = %x0A

                                ; linefeed

 

        LWSP           =  *(WSP / CRLF WSP)

                                ; Use of thislinear-white-space rule

                                ;  permits lines containing only white

                                ;  space that are no longer legal in

                                ;  mail headers and have caused

                                ;  interoperability problems in other

                                ;  contexts.

                                ; Do not usewhen defining mail

                                ;  headers and use with caution in

                                ;  other contexts.

 

        OCTET          =  %x00-FF

                                ; 8 bits ofdata

 

         SP             = %x20

 

        VCHAR          = %x21-7E

                                ; visible(printing) characters

 

        WSP            =  SP / HTAB

                                ; white space

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值