anchor.diff:  		end),
   	ok.
   
  -parse_regex([$s,$/|Rest]) ->
  -	case split_slashes(Rest) of
  -		[F,R] ->
  -			{ok, F, R, []};
  -		[F,R,O] ->
  -			Opts = lists:map(fun
  -						($g) -> global;
  -						($i) -> caseless;
  -						($u) -> unicode;
  -						(T) -> throw({error, ["Unknown option character ",T]})
  -					end, O),
  -			{ok, F, R, Opts};
  -		_ -> false
  -	end;
  +parse_regex([$s,$s,$/|Rest]) -> parse_regex0(Rest, self);
  +parse_regex([$s,$/|Rest]) -> parse_regex0(Rest, all);
   parse_regex(_) -> false.
   
  +parse_regex0(Rest, Type) ->
  +	case split_regex(Rest) of
  +		false -> false;
  +		Regexes ->
  +			case catch lists:map(fun
  +						([Find, Replace, Options]) ->
  +								{Find, Replace, opts(Options)};
  +						([Find, Replace]) ->
  +								{Find, Replace, []};
  +						(_) -> throw({error, "Invalid regex"})
  +					end, Regexes) of
  +				{error, T} -> {error, T};
  +				Regex2 -> {ok, Type, Regex2}
  +			end
  +	end.
   
  -split_slashes(Str) -> split_slashes(Str, [], []).
  +opts(Opts) ->
  +	lists:map(fun
  +			($g) -> global;
  +			($i) -> caseless;
  +			($u) -> unicode;
  +			(T) -> throw({error, ["Unknown option character ",T]})
  +		end, Opts).
   
  -split_slashes([$/|Str], Curr, Lst) -> split_slashes(Str, [], [lists:reverse(Curr)|Lst]);
  -split_slashes([$\\,$/|Str], Curr, Lst) -> split_slashes(Str, [$/|Curr], Lst);
  -split_slashes([$\\,Chr|Str], Curr, Lst) -> split_slashes(Str, [[$\\,Chr]|Curr], Lst);
  -split_slashes([Chr|Str], Curr, Lst) -> split_slashes(Str, [Chr|Curr], Lst);
  -split_slashes([], Curr, Lst) -> lists:reverse([lists:reverse(Curr) | Lst]).
  +split_regex(Str) -> split_regex(Str, [], [], []).
  +
  +split_regex([$ |Str], [], [], R) -> split_regex(Str, [], [], R); % ignore spaces before first / in each regex
  +
  +split_regex([$/|Str], [], CR, R) -> split_regex(Str, [], CR, R);
  +split_regex([$/|Str], CX, CR, R) -> split_regex(Str, [], [lists:reverse(CX)|CR], R);
  +
  +split_regex([$\\,$/|Str], CX, CR, R) -> split_regex(Str, [$/|CX], CR, R);
  +split_regex([$\\,Chr|Str], CX, CR, R) -> split_regex(Str, [Chr|CX], CR, R);
  +split_regex([$;|Str], CX, CR, R) when length(CR) == 2 -> split_regex(Str, [], [], [lists:reverse([lists:reverse(CX)|CR])|R]);
  +split_regex([Chr|Str], CX, CR, R) -> split_regex(Str, [Chr|CX], CR, R);
  +
  +split_regex([], [], [], R) -> lists:reverse(R);
  +split_regex([], [], CR, R) -> split_regex([], [], [], [lists:reverse(CR) | R]);
  +split_regex([], CX, CR, R) -> split_regex([], [], [lists:reverse(CX)|CR], R).
   
   % KEYBOARD LAYOUTS
   
  
positive.code: handle_event(msg_nocommand, {#user{nick=Nick}, Chan, Tokens}) ->
  	Msg = string:join(Tokens, " "),
  	case catch parse_regex(Msg) of
  		{ok, Find, Replace, Options} ->
  			do_regex(Find, Replace, Options, Chan);
  		{error, Err} ->
  			core ! {irc, {msg, {Chan, [Nick, ": ", Err]}}};
  		_ ->
  
negative.code: 					throw(end_iteration)
  			end
  		end, foo, config:get_value(temp, [?MODULE, lines, Chan], [])).
  
  apply_all_check(Line, Regexes) ->
  	lists:foldl(fun({F,R,O},L) ->
  			case re:replace(L,F,R,[{return,binary}|O]) of
  				L ->
  					throw(err_nochange);
  				NL -> NL
  			end
  		end, Line, Regexes).
  
  apply_all(Line, Regexes) ->
  	lists:foldl(fun({F,R,O},L) ->
  			re:replace(L,F,[2,R,2],[{return,binary}|O])
  		end, Line, Regexes).
  
  remove_line(Nick, Chan, Type, Line) ->
  	config:mod_get_value(temp, [?MODULE, lines, Chan],
  