使用正则表达式匹配
Match using regular expression
(我想在编辑文本中验证车号 android)
我的字符串示例类似于 this:gj05rs1234
FIrst (gj) char 是字符。
第二个 (05) 是数字。
第三个(rs)是字符
第四个(1234)是数字
我想要 java 中的正则表达式...
请帮助我为此表达式生成正则表达式
我想你想要这样的东西,
System.out.println(string.matches("[a-z]{2}\d{2}[a-z]{2}\d{4}"));
我想你可以按照这个 link 来格式化正则表达式
http://examples.javacodegeeks.com/core-java/lang/string/java-string-format-example/
(我想在编辑文本中验证车号 android)
我的字符串示例类似于 this:gj05rs1234
FIrst (gj) char 是字符。 第二个 (05) 是数字。 第三个(rs)是字符 第四个(1234)是数字
我想要 java 中的正则表达式... 请帮助我为此表达式生成正则表达式
我想你想要这样的东西,
System.out.println(string.matches("[a-z]{2}\d{2}[a-z]{2}\d{4}"));
我想你可以按照这个 link 来格式化正则表达式
http://examples.javacodegeeks.com/core-java/lang/string/java-string-format-example/