正規表現とマッチした部分文字列を置換します。
戻り値
例外のスロー
regexp が有効な正規表現を含まない文字列の場合、または output-template のキャプチャされた部分文字列の参照が regexp と一致しない場合、例外をスローします。例
| 例 | |
{import * from CURL.LANGUAGE.REGEXP}
{value
let str:String =
"juice, eggs and bacon, sausage and milk, I love food"
{regexp-subst "juice\|bacon\|milk\|food",
str,
"SPAM",
replace-all?=true}
} |
例
| 例 | |
{import * from CURL.LANGUAGE.REGEXP}
{regexp-subst "(\\w+) is good",
"Everyone knows that food is good",
"\\1 is OK, but Curl is great"} |