I may have some more questions regarding this class I am taking right now, so I'll be making a thread just to make sure.
Anyways, my friend discovered in the course text a possible error. It says that the regular expression for a legal floating-point constant in Pascal is as follows:
(ε|+|-)(0|d*).(0|d*)
ε = null character
d = 0..9
The text says this ensures that a number exists on both the left and right sides of the decimal point. But how can that be?
If I choose ε and d* in both instances and set them to have zero repetitions, that would leave me with only the decimal point (from what I saw, this caused an error in Pascal).
Thus, I proposed this:
(ε|+|-)((d+.d*)|(d*.d+))
This ensures that we have at least one digit on the left or right sides of the decimal, right? Is there a better way to do this?