Skip to content

Commit 45d5940

Browse files
committed
fix: correct pattern links for string methods
The links for the string methods were pointing to a non-existent url. This was because the section 6.4.1 doesn't exist, but rather 5.4.1 has the pattern section.
1 parent 64c7084 commit 45d5940

File tree

1 file changed

+25
-6
lines changed

1 file changed

+25
-6
lines changed

locale/en-us/meta.lua

+25-6
Original file line numberDiff line numberDiff line change
@@ -647,11 +647,13 @@ string.char =
647647
'Returns a string with length equal to the number of arguments, in which each character has the internal numeric code equal to its corresponding argument.'
648648
string.dump =
649649
'Returns a string containing a binary representation (a *binary chunk*) of the given function.'
650-
string.find =
650+
string.find['>5.2'] =
651651
'Looks for the first match of `pattern` (see §6.4.1) in the string.'
652+
string.find['=5.1'] =
653+
'Looks for the first match of `pattern` (see §5.4.1) in the string.'
652654
string.format =
653655
'Returns a formatted version of its variable number of arguments following the description given in its first argument.'
654-
string.gmatch =
656+
string.gmatch['>5.2'] =
655657
[[
656658
Returns an iterator function that, each time it is called, returns the next captures from `pattern` (see §6.4.1) over the string s.
657659
@@ -664,17 +666,34 @@ As an example, the following loop will iterate over all the words from string s,
664666
end
665667
```
666668
]]
667-
string.gsub =
669+
string.gmatch['=5.1'] =
670+
[[
671+
Returns an iterator function that, each time it is called, returns the next captures from `pattern` (see §5.4.1) over the string s.
672+
673+
As an example, the following loop will iterate over all the words from string s, printing one per line:
674+
```lua
675+
s =
676+
"hello world from Lua"
677+
for w in string.gmatch(s, "%a+") do
678+
print(w)
679+
end
680+
```
681+
]]
682+
string.gsub['>5.2'] =
668683
'Returns a copy of s in which all (or the first `n`, if given) occurrences of the `pattern` (see §6.4.1) have been replaced by a replacement string specified by `repl`.'
684+
string.gsub['=5.1'] =
685+
'Returns a copy of s in which all (or the first `n`, if given) occurrences of the `pattern` (see §5.4.1) have been replaced by a replacement string specified by `repl`.'
669686
string.len =
670687
'Returns its length.'
671688
string.lower =
672689
'Returns a copy of this string with all uppercase letters changed to lowercase.'
673-
string.match =
690+
string.match['>5.2'] =
674691
'Looks for the first match of `pattern` (see §6.4.1) in the string.'
675-
string.pack =
692+
string.match['=5.1'] =
693+
'Looks for the first match of `pattern` (see §5.4.1) in the string.'
694+
string.pack['>5.2'] =
676695
'Returns a binary string containing the values `v1`, `v2`, etc. packed (that is, serialized in binary form) according to the format string `fmt` (see §6.4.2) .'
677-
string.packsize =
696+
string.packsize['>5.2'] =
678697
'Returns the size of a string resulting from `string.pack` with the given format string `fmt` (see §6.4.2) .'
679698
string.rep['>5.2'] =
680699
'Returns a string that is the concatenation of `n` copies of the string `s` separated by the string `sep`.'

0 commit comments

Comments
 (0)