Terraria Wiki:DPL Manual/dplreplace

Terraria Wiki
이동: 둘러보기, 검색
Manual dplreplace

Syntax[원본 편집]

  {{#dplreplace:text|pattern|replacement}}

Effect[원본 편집]

Replaces the given pattern within the text by replacement.

pattern is a regular expression as defined by php preg_replace().

replacement may contain references to matching parts.

Example[원본 편집]

 {{#dplreplace:abrakadabra|ab|AB}}     returns:   ABrakadABra
 {{#dplreplace:abrakadabra|/a(.*?)r/|A\1_r_}}  returns:   Ab_r_Akadab_r_a

The second example only replaces "a" by "A" if there is an "r" somewhere after the "a".