Can someone give me a step-by-step, please?
Can someone give me a step-by-step, please?
How can I use Global Lua Modules/String to repeat a string like:
word XWhere X starts being 1, and it's incremented by 1 at each repetition?
In other words, I want to input
|source=word X |count=4And the result should be:
word 1 word 2 word 3 word 4 Is that possible with that module only?
I couldn't find or understand how to do it with the doc.
I'm making an infobox wherein I want to be able to consistently link to a social media site.
Some inputs are simply of the format of a username, while other inputs are of the "https://twitter.com/something" type. There's also some other pages where it's "@something". And I was thinking I could use Lua to filter out either the Twitter domain, or the @ symbol (or ideally, also the URL with a format such that there's a "www." inside as well), if any are in the input.
I was doing some tests earlier on my user page, and thing is, the only way I could find {{String}} being able to remove all three is by stacking them, which sounds horribly inefficient.
Quantifiers like `?` for the patterns accepted by the String template, and by upstream Lua, apparently can only apply to individual characters, so it doesn't detect whenever I try to insert the "www." bit inside `(? )?` syntax.
I was thinking the domain should be placed inside parentheses and then be |-able with the @ symbol, thus `^(https://(?:www%.)?twitter%.com/|@)`, but then that pipe character conflicts with how MediaWiki templates are invoked! And I don't know how to escape it... replacing it with {{!}} doesn't seem to work, and I can get why that is.
So that leads me to stacking String regex-filtering. Is there a better way?