如題:我想要實(shí)現(xiàn)的功能是替換stock(1000, 1),將1000替換成其他內(nèi)容。最開始我寫的正則表達(dá)式是var reg = /(?=stock\()(\d+)/;var str = 'stock(1000,10)';str.replace(reg, 999);但是其實(shí)str.match(reg)卻返回null還請各位大佬們指點(diǎn)
js如何在替換正則表達(dá)式的某個分組中的內(nèi)容
ibeautiful
2018-12-19 18:17:28