Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Conversation

@ghost
Copy link

@ghost ghost commented Jan 29, 2015

#9

The correct regular expression using lookaheads and lookbehinds is:

-?(?=[1-9]|0(?!\\d))\\d+(\\.\\d+)?([eE][+-]?\\d+)?

The comments were removed as I couldn't figure out a sane way to squash everything into a single string. Perhaps this grammar was copied verbatim from the TextMate bundle? using some sort of automated tool.

Anyway, maybe it would be more useful to have a separate file with comments for all the regular expressions. What do you think?

Source

@ghost ghost changed the title Fix grammar to valiate JSON numbers. Fix grammar to validate JSON numbers. Feb 1, 2015
kevinsawicki added a commit that referenced this pull request Feb 3, 2015
Fix grammar to validate JSON numbers.
@kevinsawicki kevinsawicki merged commit f58c024 into atom:master Feb 3, 2015
@kevinsawicki
Copy link
Contributor

Cool, thanks for tightening this up

@ghost
Copy link
Author

ghost commented Feb 5, 2015

😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant