Search results
Results from the WOW.Com Content Network
Regular expressions (or regex) are a common and very versatile programming technique for manipulating strings. On Wikipedia you can use a limited version of regex called a Lua pattern to select and modify bits of text from a string. The pattern is a piece of code describing what you are looking for in the string.
The string-search functions in Lua script can run extremely fast, comparing millions of characters per second. For example, a search of a 40,000-character article text, for 99 separate words (passed as 99 parameters in a template), ran within one second of Lua CPU clock time.
Lua patterns are used to define, find and handle a pattern in a string. It can do the common search and replace action in a text, but it has more options that doing plain text only. It can do the common search and replace action in a text, but it has more options that doing plain text only.
This function allows one to replace a target string or pattern within another string. To Lua programmers: this function works internally by calling mw.ustring.gsub. Usage: {{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}} OR
This template uses Lua: Module:String ; Returns a modified copy of a given text, with the first occurrence of a find-string replaced with a replacement-string. Usage ...
(string):gsub(find, replace) Lua: string copyReplaceAll: find with: replace: Smalltalk (Squeak, Pharo) string map {find replace} string: Tcl: StringReplace[string, find-> replace] Mathematica: strings.Replace(string, find, replace, -1) Go: INSPECT string REPLACING ALL/LEADING/FIRST find BY replace: COBOL: find_regex ⎕R replace_regex ⊢ ...
This function allows one to replace a target string or pattern within another string. To Lua programmers: this function works internally by calling mw.ustring.gsub. Usage: {{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}} OR
Returns string with the first n occurrences of target replaced with replacement. Omitting count will replace all occurrences. Space counts as a character if placed in any of the first three parameters.