任何人都可以给我一些正则表达式模式,这些模式将从一些示例字符串中提取版本号(1.5),例如
"jdk1.5","jdk-v1.5","jdk-V1.5","jdk V1.5","jdkv1.5","jdk version1.5","1.5.6","v1.5","V1.5","version 1.5","Version 1.5","14.5.4","1.5.4","14.5.4""jdj14.5"
我想将正则表达式模式存储在字符串数组中,并将使用上述字符串检查这些模式。如果与任何存储的模式匹配,则输出应该是版本号 1.5。我只想从上面的字符串中提取版本号(1.5)。
有效的字符串格式:"jdk1.5","jdk-v1.5","jdk-V1.5","jdk V1.3","jdkv1.4","jdk version1.5","1.5.6 ","v1.5","V1.5","1.5 版","1.5 版","14.5.4","1.5.4","14.5.4""jdj14.5","14.52. 3.42"
无效的字符串格式:"jdk1..2","jdk.1.2.",".1.2."