项目作者: macabeus

项目描述 :
A simple project to parse regexp with parser combinator
高级语言: Elixir
项目地址: git://github.com/macabeus/ElixirRegexpParser.git
创建时间: 2017-10-28T14:48:11Z
项目社区:https://github.com/macabeus/ElixirRegexpParser

开源协议:

下载




Logo

A simple project (for studying purposes) to parse regex with combine library.

  1. RegexpParser.parse("er?lx.r\\s[^abc]+\\w?\\W{2}\\d")
  2. > [
  3. %RegexpParser.Character{char: "e", quantifier: nil},
  4. %RegexpParser.Character{char: "r", quantifier: %RegexpParser.Quantifier{max: 1, min: 0}},
  5. %RegexpParser.Character{char: "l", quantifier: nil},
  6. %RegexpParser.Character{char: "x", quantifier: nil},
  7. %RegexpParser.Dot{quantifier: nil},
  8. %RegexpParser.Character{char: "r", quantifier: nil},
  9. %RegexpParser.BackslashLetter{backslash_letter: "s", quantifier: nil},
  10. %RegexpParser.List{characters: ["a", "b", "c"], except: true, quantifier: %RegexpParser.Quantifier{max: nil, min: 1}},
  11. %RegexpParser.BackslashLetter{backslash_letter: "w", quantifier: %RegexpParser.Quantifier{max: 1, min: 0}},
  12. %RegexpParser.BackslashLetter{backslash_letter: "W", quantifier: %RegexpParser.Quantifier{max: 2, min: 2}},
  13. %RegexpParser.BackslashLetter{backslash_letter: "d", quantifier: nil}
  14. ]

TODO

Metacharacters Implemented
Dot Yes!
Backslash-letter Yes!
Lists Yes!
Quantifiers Yes!
Anchors No
Escape No
Or No
Group No