我需要在一个更长的字母数字数据串中识别子字符串'X.123'和/或'X.8'。例如:
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)。
非常感谢您的帮助!