API FindAndReplaceTags

From Vendetta Lua
Jump to: navigation, search

FindAndReplaceTags

Definition:
FindAndReplaceTags(string text, table matches) -> string ret1
Description:
Replaces all occurances of with < and > enclosed substrings in text with matching values from the provided table
Arguments:
test string to replace tags in
matches table with tags/replacement pairs
Returns:
ret1: converted text
Example:

FindAndReplaceTags("hi this is a<br>linebreak", {br="\n"})<br>
-> "hi this is a
linebreak"