4
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 3 years have passed since last update.

サクラエディタで先頭0埋め

Last updated at Posted at 2020-07-10

#はじめに
サクラエディタで数値先頭0埋めする方法。

#手順
正規表現で置換を行う。

以下、例。
1
12
123
1234
を前4桁で0埋めする

正規表現で最低でも4桁になるように先頭に0を入れる
^

000
1.png

下4桁で切り出し
^0*(\d{4,})

$1
※先頭の余分な0を除いた4桁の数字
2.png

0001
0012
0123
1234
となる。

4
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
4
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?