LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-28-2004, 11:28 AM   #1
browneyes
LQ Newbie
 
Registered: Sep 2004
Distribution: Suse 9.2
Posts: 21

Rep: Reputation: 15
Newbie need Little Help=)


Consider a specification for numerical constants which conform to the following restrictions:

1.at least one digit precedes the decimal point
2. the decimal point is optional, but if present is followed by at least one digit
3. Except as demanded by (1) and (2) leading and trailing zero digits are not permitted.

Assuing D is any digit between 1 and 9, e.g.,
D = ( 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 )

(a) Write a regular expression to describe these strings.

(b) Show this regular expression as a deterministic finite state machine. Be sure to indicate the state state and all accepting states.


This is one of my hw question, and I am just stuck for days, any help would be appreciated.

Thank You.
 
Old 09-28-2004, 12:09 PM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
The forum rules says:

Do not expect LQ members to do your homework - you will learn much more by doing it yourself.

But you're lucky I'm in good mood, so here's my suggestion:

Code:
D*[OD]+(.[0D]*D)?
 
Old 09-28-2004, 12:17 PM   #3
browneyes
LQ Newbie
 
Registered: Sep 2004
Distribution: Suse 9.2
Posts: 21

Original Poster
Rep: Reputation: 15
oh, I didn't see that rule, sorry.

Thanks for your help.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
security newbie, but not Linux newbie. advice on secure delete tools mattie_linux Linux - Security 19 08-15-2005 01:50 AM
Linux semi-newbie and Wine vary newbie geovolt_os1 Linux - Software 4 04-19-2005 11:03 AM
newbie;I am a linux newbie who has installed slackware and have run into a few proble MollyJolly Slackware - Installation 6 06-01-2004 11:21 AM
How To Update To Slackware-Current For a Newbie, By a Newbie :) windsok Slackware 1 09-18-2003 08:53 PM
ipchains newbie. Kernel newbie skeletal29 Linux - Security 3 06-02-2002 03:30 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration