Single string matching (works with a latin character, but doesn't work with an integer)
See original GitHub issue$ echo 'test -> "a"' > ./grammar.ne
$ nearleyc ./grammar.ne --out ./grammar.js
$ nearley-test ./grammar.js --input 'a'
Table length: 2
Number of parses: 1
Parse Charts
Chart: 0
0: {test → ● "a"}, from: 0
Chart: 1
0: {test → "a" ● }, from: 0
Parse results:
[ [ 'a' ] ]
$ echo 'test -> "1"' > ./grammar.ne
$ nearleyc ./grammar.ne --out ./grammar.js
$ nearley-test ./grammar.js --input '1'
Table length: 1
Number of parses: 0
Parse Charts
Chart: 0
0: {test → ● "1"}, from: 0
Parse results:
[]
Whats the reason one produces a result and the other does not?
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Matching special characters and letters in regex - Stack Overflow
ie Whenever a character other than a letter, a number or special characters &-._ comes, the string should evaluate as invalid. How can...
Read more >Everything you need to know about Regular Expressions
After reading this article you will have a solid understanding of what regular expressions are, what they can do, and what they can't...
Read more >String matching where one string contains wildcard characters
Write a function that returns true if the two strings match. The following are allowed wild card characters in first string.
Read more >Regular expression syntax cheatsheet - JavaScript | MDN
Matches a single white space character, including space, tab, form feed, line feed, and other Unicode spaces.
Read more >Regular Expressions :: Eloquent JavaScript
It just enforces that the regular expression matches only when a certain condition holds at the place where it appears in the pattern....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah, no kidding. If you want, you can send me a PR.
@Hardmath123 could solve this by performing the magical
Object.prototype.toString()
method 😉