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 3595278
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T19:49:52+00:00 2026-05-18T19:49:52+00:00

I am trying to convert a regular expression into NFA and I am having

  • 0

I am trying to convert a regular expression into NFA and I am having trouble in it. If you are unaware of the subject then this is a link to what I am saying here.

The problem here is that the author explains that given a string of characters you first convert it into postfix. He mentions that in real time it would be better to draw the NFA while parsing the R.E but has given no such method to do so…..

I am having problems on starting this up. Can anyone please guide me on what should be the algorithm to create NFA while parsing the string because the parenthesis are a big problem as they are supposed to be done first……

PS:- I am actually not sure what other tags should be placed in this….Also this is NOT homework

  • 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-05-18T19:49:53+00:00Added an answer on May 18, 2026 at 7:49 pm

    Here’s a combined parser, NFA builder, and NFA interpreter in one page of Python. I hope I’m not spoiling the fun of figuring it out for yourself — you might prefer to wait and keep hacking before following the link.

    It’s sort of like deinst’s suggestion, but ‘backwards’. As deinst says, you can have the parser build an NFA for each subexpression of the regular expression and then hook them up as you go. For instance, for (a|b)*c you’d first parse (a|b)* to get NFA #1, then parse c to get NFA #2, then clobber NFA #1’s final state, changing it to #2’s start state. And so on recursively. This is the conventional answer.

    My code instead first creates a trivial NFA with just an accepting state and nothing more. Then it parses c, extending the NFA: now we have an NFA that checks for c and then accepts. Next, it recursively parses (a|b)*, still extending the NFA. The contract of the parser, given a string re and an NFA k, is to parse the string to produce a result NFA that ends up at the start of k when re matches. This approach avoids the need to clobber bits of the partial NFAs to hook them together.

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

Sidebar

Related Questions

I'm trying use regular expression to convert special characters in an url. Here's my
I am trying to get a working regular expression to convert standard HTML code
Trying to convert this c code into MIPS and run it in SPIM. int
I'm trying to to convert an existing PHP regular expression to apply to a
I'm trying to write a single regular expression to convert all uppercase words to
I am trying to convert the following regular expression from Java to .NET: (?i:(?:([^\d,]+?)\W+\b((?:CA|SD|SC|CT|DC)\b)?\W*)?(\d{5}(?:[-
I appear to be having trouble creating a regular expression in Haskell, what I'm
I'm trying to convert a Python script into PHP. The following 2 regular expressions
I'm trying to write a regular expression that will convert a full path filename
Trying to convert the following but am having difficulty. Can anyone see where I'm

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.