regex - Validated a number with 2 decimal place and less than 1000 -


i know there many similar question being asked, need on , if possible please provide me easy follow , easy understand tutorial regex.

here valid scenario 999.99 valid 100.00 valid 1111.00 invalid 111.002 invalid

the code should written in pattern dont know how code output want

thank in advance!

you can set restriction in xsd document:

<xsd:simpletype name="2dnumber">     <xsd:restriction base="xsd:token">         <xsd:pattern value="[0-9]{1,3}\.[0-9]{2}|1000.00"/>     </xsd:restriction> </xsd:simpletype> 

or if want use xs:decimal directly:

<xsd:simpletype name="2dnumber">     <xsd:restriction base="xsd:decimal">         <xsd:minexclusive value="0"/>         <xsd:maxexclusive value="1000"/>         <xsd:fractiondigits value="2"/>     </xsd:restriction> </xsd:simpletype> 

Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -