6f6 @verb #51:"r*egexp_subst" any any any rxdo #60 @program #51:"r*egexp_subst" any any any if (callers() && caller != this) return E_PERM endif if (!this.escape_xml) argstr = player:input_get_raw(argstr) endif if (!(who = this:loaded(player))) player:tell(this:msg_nothing_loaded()) elseif (typeof(subst = this:parse_subst(argstr)) != $LIST) player:tell(tostr(subst)) elseif (typeof(range = this:parse_range(who, {"_", "1"}, @$string_utils:explode(subst[4]))) != $LIST) player:tell(range) elseif (range[3]) player:tell("Junk at end of cmd: ", range[3]) else fromstr = subst[1] tostr = subst[2] global = index(subst[3], "g", 1) case = !index(subst[3], "c", 1) munged = {} text = this.texts[who] changed = {} for line in [from = range[1]..to = range[2]] t = t0 = text[line] if (!fromstr) t = tostr + t elseif (global) p = 1 while (m = match(t[p..$], fromstr, case)) if (m[1] == m[2]) break "Don't match the empty string!" endif t[p + m[1] - 1..p + m[2] - 1] = substitute(tostr, m) p = p + m[2] endwhile elseif (m = match(t, fromstr, case)) t[m[1]..m[2]] = substitute(tostr, m) endif if (strcmp(t0, t)) changed = {@changed, line} endif munged = {@munged, t} endfor if (!changed) player:tell("No changes in line", from == to ? tostr(" ", from) | tostr("s ", from, "-", to), ".") else this.texts[who] = {@text[1..from - 1], @munged, @text[to + 1..length(text)]} this.changes[who] = text this.times[who] = time() for line in (changed) this:list_line(who, line) endfor endif endif "Last modified by Dax (#789) on Wed May 4 06:46:00 2005 MDT." . 0