Hi,
I am entirely new to regex. I need to use regular-expression to match correct answers for an online quiz. Is there any expression for matching a decimal number that may be entered in a number of different ways. For example,
0.666666...
could match
.66, .67, .66666, .667, 0.6667 etc.
thanks,
~russ
match a specific decimal number 0.666666
Moderator: General Moderators
- greyhoundcode
- Forum Regular
- Posts: 613
- Joined: Mon Feb 11, 2008 4:22 am
Re: match a specific decimal number 0.666666
How about this one:
You'd need to trim out any whitespace from the answer first of all.
Code: Select all
^0?\.6+7?$