문제

From example on http://zaach.github.io/jison/docs/#specifying-a-language

[0-9]+("."[0-9]+)?\b  return 'NUMBER';

why in this regexp used "." instead of \. ?

도움이 되었습니까?

해결책

Because that's a Jison grammar tokenization rule not an exact regex.
In Jison a token is surrounded in ".

In the compiled rules you can see the rule converted to a regex:

["[0-9]+(?:\\.[0-9]+)?\\b", "return 'NUMBER';"],
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top