Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js string only positive float numbers

if ("10".match(/^(?!0d)d*(.d+)?$/)) {
	console.log('match')
} // expected output: 'match'

// matches
	// 10.0
	// 0.10
	// 123.456
// Does not match
	// a1
	// 00.10
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #string #positive #float #numbers
ADD COMMENT
Topic
Name
6+6 =