我需要在更长的字母数字数据字符串中识别子字符串“X.123”和/或“X.8”。例如:使用RegEx从字母数字字符串中提取数字
A cow flew over the moon in the X.123 module, not the X.124.3 module,
and certainly not the X.125C78 module. The cow poo-pooed the X.8 module.
我该如何排除第二和第三个实例?这是我想出迄今获得“X.123”部分:
/[X][\.][0-9]{1,4}/
我不完全知道如何使表达停止在任何非数字字符(例如:X124C78 )
帮助非常感谢!
+1的飞牛;) – Beat