0

I'm using regular expression in AutoWikiBrowser to replace the input of several values with just one value, such as this:

|value1=4
|value2=5
|value3=6

To this:

|value={{#expr:4+5+6}}

While the correct result does show on the page, it does not look good in the code itself, so I'm trying to find a way to make it the result only (in this case value=15) but so far no luck. Can someone help me with out showing how to make this possible?

P.S. I tried the search function but didn't find a similar question.

g0urra
  • 3
  • 2

1 Answers1

0

MediaWiki parser allows the templates can be subst'ed, ie replaced by their rendering. That's also true for parser functions call.

You can subst a template prefixing the template call by subst:.

|value={{subst:#expr:4+5+6}}

Reference: Substitution on MediaWiki manual

Example: diff (the expression used is in the edit summary, the result in the diff)

Dereckson
  • 1,340
  • 17
  • 30
  • I had used `subst:` previously when it comes to text but it didn't output properly, I'm glad it's not the same with numbers. Thanks! – g0urra Jun 22 '16 at 07:07