0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

S_ReplaceAll()の置換オプションについて

Last updated at Posted at 2023-09-02

[すべて置換(A)]を[キーマクロの記録開始(R)]で記録すると、次のようなコードになります。
置換オプション(=第3引数)が何を意味するのか、調べた結果をまとめました。

※置換前は「タブor半角スペースの連続」、置換後は「半角スペース1個」

image.png

S_ReplaceAll('[\\t ]+', ' ', 142);	// すべて置換(※連続するスペースやタブを、スペースに置換)
S_ReDraw(0);	                    // 再描画

置換オプションは、次のようなものがあり、必要なオプションの値を足した合計を引数に指定するようです。

置換オプション 値(10進)
英大文字と小文字を区別する(C) 2
正規表現(E) 4
見つからないときにメッセージを表示(M) 8
置換対象 - 選択文字(0) 0
範囲 - 選択範囲(S) 128

以下のサイトを参考にしました。

0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?