RobertP Posted April 18, 2012 Share Posted April 18, 2012 I need to limit the characters after the decimal to 1 or 2. this is what i have. ^[0-9]+(?:\.[0-9]*)?$ I think i have to add {1,2}, but no idea where. Any help would be greatly appreciated. Link to comment https://forums.phpfreaks.com/topic/261201-expression-for-decimals/ Share on other sites More sharing options...
xyph Posted April 18, 2012 Share Posted April 18, 2012 * means between 0-unlimited times. You probably want that as {1,2} Link to comment https://forums.phpfreaks.com/topic/261201-expression-for-decimals/#findComment-1338591 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.