Machine-translated by Google. Questions are authored in English.
Top

Discussion

A regular expression for an unsigned integer is

  • A.an optional sign followed by one or more decimal digits
  • B.any number of digits including none at all in sequence
  • C.digits followed by an optional exponent part in the literal
  • D.one or more digits with no sign or decimal point permitted

Answer: D

Correct answer: one or more digits with no sign or decimal point permitted

An unsigned integer is precisely one or more decimal digits, written digit+. The sign is excluded because it is unsigned, and admitting zero digits would let the empty string be a number. The exponent and the decimal point belong to the pattern for a floating point literal, which is built up separately from the same digit class.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.