Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8897765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:25:56+00:00 2026-06-15T00:25:56+00:00

I was reading the How Browsers Work article here: How Browsers Work (It’s a

  • 0

I was reading the “How Browsers Work” article here: How Browsers Work (It’s a great read.)

But at one point, they mention this as a rule of their grammar defining an integer:

INTEGER :0|[1-9][0-9]*

Is it, or is it not, exactly the same (and simpler) to write:

INTEGER :[1-9]*[0-9]

I couldn’t think of a case that did not satisfy both rules, nor a reason why the first rule would be preferred.

Is there a reason for including a simple base case (such as 0), or is it just pedantics?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T00:25:57+00:00Added an answer on June 15, 2026 at 12:25 am

    These two expressions are different: the first one will take 101, but the second one wouldn’t. The expression from the book is pretty good at matching integers while disallowing leading zeros.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After reading this article I don't have a clear answer: http://palizine.plynt.com/issues/2010Oct/bypass-xss-filters/ Will browsers interpret
I've been reading about the @font-face rule and trying to work out if it's
I have been reading these forums for some time, but this is my first
Im reading the mongodb guide, but I dont get this: mongodb://fred:foobar@localhost It says I
I have been reading around this subject all morning, but I am still confused
I've been reading about problems people are having with browsers caching an old version
After reading http://www.pragprog.com/magazines/2010-03/javascript-its-not-just-for-browsers-any-more I'm wondering which is the best IDE to develop server-side javascript
I was reading about IDN homograph atack and didn't find exactly stated does browsers
Reading the Scala by Example book and there is this example when Martin explains
Reading this blog post about HttpOnly cookies made me start thinking, is it possible

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.