to Replace Rule
fun String.toReplaceRule(isRegex: Boolean = false, matchIndex: Int? = null, matchRange: IntRange? = null, newString: CharSequence? = null, replacementMatch: OnSpanReplacementMatch? = null): ReplaceRule
Content copied to clipboard
创建替换规则
Receiver
查找的字符串或正则文本
Parameters
is Regex
receiver是否为正则
match Index
单一匹配位置 (matchRange不为null时优先使用matchRange)
match Range
匹配范围
new String
替换文本(null 为不替换)
replacement Match
匹配时回调