Physics · Theory of Computation
Consider an NFA with epsilon-transitions designed to accept strings corresponding to a lexical token 'id'. The token 'digit' corresponds to the regular expression [0-9] and 'letter' corresponds to [a-zA-Z]. If a valid identifier must begin with a letter followed by any combination of letters or digits, which of the following regular expressions represents the token 'id'?
- 1letter (letter | digit*)
- 2(letter | digit)
- 3(letter | digit) letter
- 4letter (letter | digit)✓
Correct answer
letter (letter | digit)
Download Single Question PDF
Save this question and verified answer as a clean study sheet with live clickable link.
Share with Friends & Study Groups
Challenge your peer aspirants on WhatsApp or Telegram to solve this question!
Preparing for Physics?
Practice full-length mock tests with real exam timers, instant score analysis, and all-India ranking.
Want more practice questions on Theory of Computation?
Solve complete topic-wise tests with detailed solutions on GkGet.
Related Practice Questions
Recommended practice questions in Physics · Theory of Computation