我想找到"的第一个实例,"在一行记事本++。我觉得这可能是一个简单的答案,但我已经尝试了很长一段时间找到解决方案。
我有以下要替换的示例数据:
K8.transform.position = new Vector3 (-1249.966,-0.055,1250.139)*ObjectScale ; K1.transform.Rotate(0.000000,0.000000,0.000000) ;
用这个:
K8.transform.position = new Vector3 (-1249.966f,-0.055f,1250.139f)*ObjectScale ; K1.transform.Rotate(0.000000f,0.000000f,0.000000f) ;
唯一的区别是所有值都有额外的" f"到底。我尝试过类似
的代码Vector3 \(.*,
开始寻找第一个值。但它找不到第一个",#34;但每排最后一排, see this picture
正如我所说,我觉得这可能是一个简单的答案,但我无法找到解决方案。
答案 0 :(得分:0)
答案 1 :(得分:0)
(?<=\d)(?=[,)])
f
<强>解释强>
(?<=\d) : lookbehind, make sure we have a digit before current position
(?=[,)]) : lookahead, make sure we have a comma or a close parenthesis after current position
给定示例的结果:
K8.transform.position = new Vector3 (-1249.966f,-0.055f,1250.139f)*ObjectScale ; K1.transform.Rotate(0.000000f,0.000000f,0.000000f) ;