Hi. I wrote pattern "var patt3=/\d\.\./;" so I can check double dot occure in string. But how to find "1.11111.1" that dot occure more then once in string? Thanx
/\d\.\d*\./ - Change '*' to '+' if you don't want to match two consecutive dots - Change '\d' to '.' if you want to match any character rather than just digits.
var string="abc.123.xyz"; var array=string.split("."); var length=array.length; if(length==2) { //dot occurs ONCE } else { //0 or more than 1 time } Code (JAVASCRIPT):