Increment a number in a string in with regex

前端 未结 4 937
说谎
说谎 2020-11-28 13:15

I get the name of an input element, which is a string with a number (url1). I want to increment the number by 1 (url2

4条回答
  •  臣服心动
    2020-11-28 13:44

    Looks OK. You might want to use a regex like ^(.*?)(\d+)$, making sure the number you're grabbing is at the end of the string.

提交回复
热议问题