How to check such a single-register number entry. Lines are not allowed. Two decimal places after a dot or comma.
Example:
123.341.223.40134.12123
Try this regex:
/^(\d+(?:[\.\,]\d{2})?)$/
If $1 exactly matches your input string, then suppose it is validated.
$1
pat = re.compile('^\d+([\.,]\d\d)?$') re.match(pat, '1212') <_sre.SRE_Match object at 0x91014a0> re.match(pat, '1212,1231') None re.match(pat, '1212,12') <_sre.SRE_Match object at 0x91015a0>
Try it,
/^(\d+(?:[\.\,]\d{1,2})?)$/
Source: https://habr.com/ru/post/900020/More articles:GridView or TableLayout? - androidFacebook asks 2.0, how do I change the Accept button URL to be a non-Facebook URL? - javascripthttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/900017/how-do-i-send-a-facebook-request-that-links-to-an-external-site&usg=ALkJrhjABg2LBxAd-8ZzpJAER4DWm6WBGwRequest MongoDB for documents whose identifiers are contained in a list - c #Anonymous function does not return the correct string - stringbuilder"no ios devices available" on Xcode 4.2 and iOS 5 - iphoneIs there a way in Dojo to find all the descendants of widgets in a DOM element? - dojoNo need to list - pythonDjango's friends, how many-to-many, better remember User or UserProfile (self) in the field? - djangoHow to make Django comments use select_related () in the "user" field? - performanceAll Articles