Home
Random
Recent changes
Special pages
Community portal
Settings
About Irony Wiki
Disclaimers
Irony Wiki
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Extract
β οΈ
Warning:
You are not logged in.
Your IP address will be publicly visible
if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username instead of your IP, along with other benefits.
Anti-spam check. Do
not
fill this in!
-- Extracts certain types of strings from a larger string. Useful for passing data into Cargo tables. local p = {} -- Extracts the first instance of a number (a substring of continuous digits). Returns an empty string if none are found function extractNumber(input) local match = mw.ustring.match(input, "%d+") if match == nil then return "" else return match end end function p.main(frame) if frame.args[1] == "number" then return extractNumber(frame.args[2]) else return "" end end return p
Summary:
Please note that all contributions to Irony Wiki are considered to be released under the Creative Commons Attribution-ShareAlike (see
Irony Wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Module:Extract/doc
(
edit
)