おそらく一例は、役立つだろう。次のようなテキストファイルがあると仮定
コード:
abcdefg
faaaag
accxxcck
abbde
を使用する 六 検索と置換'のすべてのインスタンスb 'に、 ' c 'は、 'エ' 、 'と' e 'をQ 'により、
次のコマンド"を行うことができます: % sを/ [さ] /問/ gの'は結果に
コード:
aQQQQfg
faaaag
aQQxxQQk
aQQQQ
ここには、標準的な料金を除く 六 manページを代用について:
コード:
[range] s[ubstitute] [/pattern/replace/] [options] [count] [flags]
[range] & [options] [count] [flags]
[range] ~ [options] [count] [flags]
Make substitutions. In the substitution string, the characters ~ and %
may have special meanings. If the entire replace pattern is a percent
sign (%), the previous replacement pattern is used. (This can be
useful for repeating substitutions that contain back references.) The
special character ~ inserts the previous replacement string into this
replacement string.
The options can be any of the following:
c
Ask for confirmation before replacing the text.
g
Perform the replacement on all occurrences of the regular
expression on the line.
r
If no regular expression was specified, use the most recent
regular expression (used for a search) rather than the same
regular expression as used for the last substitute command.
|