0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

正規表現で数字の桁数を検索置換で増やしたメモ

Posted at
id=1
id=2
id=11
id=12

こんな感じのIDを後から1000001からにしてくれ!って言われた。
()の中身を$1でそのまま持ってこれるのに今日気がついたから悔しいからここにメモっとく。

まずは2桁を1000000万台へ

検索 id=(\d{2})
置換 id=10000$1

そして1桁を1000000万台へ

検索 id=(\d{1})
置換 id=100000$1

できた!わーい。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?