Comments (4)
I'm new to Parslet as well, so I may be wrong on this, but I think match
is supposed to match a single character class. For example, you'd get the same error if you wrote Parslet.match('01').parse('01')
If you can give up the regex functionality (and just do exact matching), you could try Parslet.str('/*').parse('/*')
from parslet.
Hi guys, you are (almost) right – match only works with regular expression strings that match a single character, eg. [a-z]
, [\n\t]
. Like @jonathanhefner said, str
seems to be the thing you are looking for. Cheers!
from parslet.
Ah thanks for the tip @floere @jonathanhefner. Brainfart on my side.
from parslet.
I forgot to post a link to the documentation: https://github.com/kschiess/parslet/blob/master/lib/parslet.rb#L126-L146. The code is very well documented in general. Cheers and have fun!
from parslet.
Related Issues (20)
- Error during inspect: undefined local variable or method 'root' HOT 2
- Alternation seems have problem when one alternative contains another. HOT 1
- Incremental parser / do not error on incomplete data HOT 2
- Is it possible to access tree output when parse fails? HOT 1
- If you use scope, context cache will hit incorrectly.
- Recursion help. HOT 1
- Support for Ruby2.7? HOT 3
- How to "override" previously set `as`'s to make things simpler. HOT 4
- Precedences in`infix_expression`
- `#error_tree` was removed but still exists in getting-started HOT 1
- rule parse error HOT 1
- json parser example not work when a array inside like [{ "b": true, "c": false , "d": [1, 2, 3]}] HOT 1
- Toggle off additional info? HOT 1
- Tricks for brace (un)matching? HOT 2
- Documentation site link pointing to github.com instead of github.io HOT 2
- 2.0.0 git tag is missing HOT 2
- Applying parslet alternatives with various length HOT 1
- repeat(1, 1) doesn't transform into array HOT 2
- `.repeat(1, 1).repeat(1, 1)` doesn't nest arrays HOT 1
- Test with Ruby 3.0 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from parslet.