如何判断编辑框内容是否少于5位数不大于16位数

来源:百度知道 编辑:UC知道 时间:2024/06/05 21:34:00
高手些个代码给我看理解下

import javax.swing.JLabel;

public class isBetweenFiveAndSixteen {
public static void main(String[] args) {
/*正则表达式*/
String regex = "^[1-9]{1}[0-9]{4,15}$";
JLabel label = new JLabel();
label.setText("1606666666666555");
boolean boo = label.getText().matches(regex);
System.out.println(boo);
}
}

vb:

dim b as boolean
if len(text1.text)>4 and len(text1.text)<17 then b=true