Make find more prominent
This commit is contained in:
parent
0aaad199a4
commit
ff2e3de580
1 changed files with 9 additions and 10 deletions
|
|
@ -23,23 +23,22 @@ provides in its standard library is inadequate:
|
||||||
|
|
||||||
=== Operations
|
=== Operations
|
||||||
|
|
||||||
[[proc-match]]
|
[[proc-find]]
|
||||||
==== match(string, Regex, start = 0, endpos = -1): RegexMatch
|
==== find(string, Regex, start = 0, endpos = -1): RegexMatch
|
||||||
|
|
||||||
Tries to match the pattern, starting at start. This means that
|
Finds the given pattern in the string between the end and start positions.
|
||||||
`"foo".match(re"f") == true`, but `"foo".match(re"o") == false`.
|
|
||||||
|
|
||||||
`start` :: The start point at which to start matching. `|abc` is `0`; `a|bc`
|
`start` :: The start point at which to start matching. `|abc` is `0`; `a|bc`
|
||||||
is `1`
|
is `1`
|
||||||
`endpos` :: The maximum index for a match; `-1` means the end of the string,
|
`endpos` :: The maximum index for a match; `-1` means the end of the string,
|
||||||
otherwise it's an exclusive upper bound.
|
otherwise it's an exclusive upper bound.
|
||||||
|
|
||||||
[[proc-find]]
|
[[proc-match]]
|
||||||
==== find(string, Regex, start = 0, endpos = -1): RegexMatch
|
==== match(string, Regex, start = 0, endpos = -1): RegexMatch
|
||||||
|
|
||||||
Finds the given pattern in the string. Bounds work the same as for
|
Like link:#proc-find[`find(...)`], but anchored to the start of the string.
|
||||||
link:#proc-match[`match(...)`], but instead of being anchored to the start of
|
This means that `"foo".match(re"f") == true`, but `"foo".match(re"o") ==
|
||||||
the string, it can match at any point between `start` and `endpos`.
|
false`.
|
||||||
|
|
||||||
[[iter-find]]
|
[[iter-find]]
|
||||||
==== iterator findIter(string, Regex, start = 0, endpos = -1): RegexMatch
|
==== iterator findIter(string, Regex, start = 0, endpos = -1): RegexMatch
|
||||||
|
|
@ -47,7 +46,7 @@ the string, it can match at any point between `start` and `endpos`.
|
||||||
Works the same as link:#proc-find[`find(...)`], but finds every non-overlapping
|
Works the same as link:#proc-find[`find(...)`], but finds every non-overlapping
|
||||||
match. `"2222".find(re"22")` is `"22", "22"`, not `"22", "22", "22"`.
|
match. `"2222".find(re"22")` is `"22", "22"`, not `"22", "22", "22"`.
|
||||||
|
|
||||||
Arguments are the same as link:#proc-match[`match(...)`]
|
Arguments are the same as link:#proc-find[`find(...)`]
|
||||||
|
|
||||||
Variants:
|
Variants:
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue