If you want to go with a regex, I'm surprised you haven't found one that worked. Here's a quick one (it worked the first time I tried it):
(?<major>d{1,3}).(?<minor>d{1,3}).(?<patch>d{1,3})(.(?<build>d{1,3}))?
It names the parts, and makes the last part optional
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…