-
March 2nd, 2008, 10:03 PM
#1
floating constant
hey everyone .. i am trying to write a regular expression for the floating constant...here's the definition of floating constant:
A floating constant consists of an integer part, a decimal point, a fraction part, an e or E, an optionally signed integer exponent and an optional type suffix, one of f, F, l or L. The integer and fraction parts both consist of a sequence of digits. Either the integer part or the fraction part (not both) may be missing; either the decimal point or the e and the exponent (not both) may be missing.
what i am trying to do is write an expresstion for it similar to this one which was done for natural numbers:
Natural numbers (integers > 0) can be represented
using:
non zero digit ! 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
digit ! 0 | non zero digit
natural number ! non zero digit digit *
-
September 29th, 2010, 05:55 PM
#2
Re: floating constant
hii all
can any one post the answer of the above question???
thanks in advance
-
October 1st, 2010, 09:55 PM
#3
Re: floating constant
why not 3 regular expressions?
1: check if its integer
2: if its a float
3: if its of the form 12.323e+3
those should be simple
01101000011001010110110001101100011011110010000001110011011001010111100001111001
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|