string = '这是新的 5000 卢比纸币'
string_to_search = '新(动态编号)卢比'
主字符串中的数字可以是任何动态值。如何匹配以“new”开头并以“rupees”结尾的字符串,中间有动态数字?
根据评论改进的解决方案:
您可以使用正则表达式解决它:
new \d* rupees
例如:
str.match(/new \d+ rupees/g);
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句