<address id="zhpbl"></address>
<noframes id="zhpbl">
<address id="zhpbl"><form id="zhpbl"><th id="zhpbl"></th></form></address>

    <em id="zhpbl"></em>

      <address id="zhpbl"><th id="zhpbl"><progress id="zhpbl"></progress></th></address>
      更多精彩內容,歡迎關注:

      視頻號
      視頻號

      抖音
      抖音

      快手
      快手

      微博
      微博

      java parse

      文檔

      java parse

      Parse是一個使用語法規則來解析輸入序列的內部DSL。Parse的規則構成:關鍵字;單字(word);設字(word:);取字(:word);整型數值;字面值;[rules];(expression)等。
      推薦度:
      導讀Parse是一個使用語法規則來解析輸入序列的內部DSL。Parse的規則構成:關鍵字;單字(word);設字(word:);取字(:word);整型數值;字面值;[rules];(expression)等。

      ? ?

      java parse是什么,讓我們一起了解一下?

      Parse是一個使用語法規則來解析輸入序列的內部DSL(在Rebol生態圈稱為“方言”)。Parse方言是TDPL家族的突出一員,常用來校驗,驗證,分解,修改輸入的數據,甚至是實現內部或者外部DSL。

      Parse的規則是由哪些元素構成的?

      關鍵字:Parse方言預留的單詞。

      單字(word):單字所綁定的值被用于規則。

      設字(word:):將單字綁定到當前的輸入流位置。

      取字(:word):恢復單字綁定的輸入流位置。

      整型數值:指定規則重復的數量或者范圍。

      字面值:匹配輸入流中對應的字面值。

      [rules]:子規則區塊。

      (expression):脫離Parse方言轉而執行Red表達式,執行完畢后返回到Parse方言。

      Parse的方法是如何實現的?

      示例代碼如下:

      const?path?=?require("path");
      const?url=require("url");
      let?str="/images/fff/123/jj.jpg";
      console.log(path.parse(str));
      結果:
      {
      ??root:?'/',
      ??dir:?'/images/fff/123',
      ??base:?'jj.jpg',
      ??ext:?'.jpg',
      ??name:?'jj'
      }
      console.log(path.sep);//?\
      let?u?=?"http://www.dxf1.cn:8080/images/fff/123/jj.jpg?id=1&name=tom#hash";
      console.log(url.parse(u));//query
      結果:
      \
      Url?{
      ??protocol:?null,
      ??slashes:?null,
      ??auth:?null,
      ??host:?null,
      ??port:?null,
      ??hostname:?null,
      ??hash:?'#hash',
      ??search:?'?id=1&name=tom',
      ??query:?'id=1&name=tom',
      ??pathname:?'//www.dxf1.cn:8080/images/fff/123/jj.jpg',//pathname?屬性是一個可讀可寫的字符串,可設置或返回當前?URL?的路徑部分
      ??path:?'//www.dxf1.cn:8080/images/fff/123/jj.jpg?id=1&name=tom',
      ??href:?'//www.dxf1.cn:8080/images/fff/123/jj.jpg?id=1&name=tom#hash'
      }
      console.log(url.parse(u,true));
      Url?{
      ??protocol:?null,
      ??slashes:?null,
      ??auth:?null,
      ??host:?null,
      ??port:?null,
      ??hostname:?null,
      ??hash:?'#hash',
      ??search:?'?id=1&name=tom',
      ??query:?[Object:?null?prototype]?{?id:?'1',?name:?'tom'?},//第二個參數為true,query屬性就會從查詢字符串格式(“a=1&b=2”)轉換為了對象格式({a:?1,b:?2})
      ??pathname:?'//www.dxf1.cn:8080/images/fff/123/jj.jpg',
      ??path:?'//www.dxf1.cn:8080/images/fff/123/jj.jpg?id=1&name=tom',
      ??href:?'//www.dxf1.cn:8080/images/fff/123/jj.jpg?id=1&name=tom#hash'
      }
      console.log(url.parse(u,??true,?true));
      Url?{
      ??protocol:?null,
      ??slashes:?true,
      ??auth:?null,
      ??host:?'www.dxf1.cn:8080',//host
      ??port:?'8080',
      ??hostname:?'www.dxf1.cn',
      ??hash:?'#hash',
      ??search:?'?id=1&name=tom',
      ??query:?[Object:?null?prototype]?{?id:?'1',?name:?'tom'?},
      ??pathname:?'/images/fff/123/jj.jpg',
      ??path:?'/images/fff/123/jj.jpg?id=1&name=tom',
      ??href:?'//www.dxf1.cn:8080/images/fff/123/jj.jpg?id=1&name=tom#hash'
      }

      以上就是小編今天的分享了,希望可以幫助到大家。

      文檔

      java parse

      Parse是一個使用語法規則來解析輸入序列的內部DSL。Parse的規則構成:關鍵字;單字(word);設字(word:);取字(:word);整型數值;字面值;[rules];(expression)等。
      推薦度:
      為你推薦
      資訊專欄
      熱門視頻
      相關推薦
      java repeat java parser java request java partial java requests java rest java result java resultset java resume java retrofit java reverse() java reverse java rotate java rsa加密 java path java paypal java phoenix java ping java pipeline java rsa公鑰加密 java pandas java override java render java region java require java resolve java resources java overload java outofmemory java outer java orm java openssl java regex java reflect java reference java redirect java rectangle java openjdk java opengl java openfire
      Top 少妇高潮太爽了在线视频