Martin Davis
asked on
Regular Expression for Height of a Person to be entered in various formats
I need a regular expression to allow a person to enter their height in the following format either
5'10 or 5'10" making the quotation marks optional for the inches. There also could be a space between the feet and inches like 5' 10 or 5' 10".
thanks for the help in advance.
5'10 or 5'10" making the quotation marks optional for the inches. There also could be a space between the feet and inches like 5' 10 or 5' 10".
thanks for the help in advance.
ASKER
Thanks! I will accept your solution. I just realized how do I make the inches part of the height optional all together. ie 5'
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
or
var pattern=new RegExp("^[0-9]+\'([ ]?[0-9]{1,2}[\"]?|)$");
if you didn't like space at tail
var pattern=new RegExp("^[0-9]+\'([ ]?[0-9]{1,2}[\"]?|)$");
if you didn't like space at tail
ASKER
Thanks fsze88 so much, I would have never figured this out.
Open in new window