Skip to content

Commit c21a423

Browse files
committed
start new doc for built-ins; fix typo
1 parent 254d590 commit c21a423

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

docs/built-ins.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# NQP Built-in Subs List
2+
3+
The following subroutines are available to use in ```nqp``` programs.
4+
They are described in ```nqp/src/core`` modules.
5+
6+
# From ```nqp/src/core/Regex.nqp```
7+
8+
## match
9+
* `match($text, $regex, :$global?)`
10+
11+
Match ```$text``` against ```$regex```. If the ```$global``` flag is
12+
given, then return an array of all non-overlapping matches.
13+
14+
## subst
15+
* `subst($text, $regex, $repl, :$global?)`
16+
17+
Substitute a match of ```$regex``` in ```$text``` with ```$replacement```,
18+
returning the substituted string. If ```$global``` is given, then
19+
perform the replacement on all matches of ```$text```.

src/core/Regex.nqp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ sub match ($text, $regex, :$global?) {
2626

2727

2828
=begin item subst
29-
Substitute an match of C<$regex> in C<$text> with C<$replacement>,
29+
Substitute a match of C<$regex> in C<$text> with C<$replacement>,
3030
returning the substituted string. If C<$global> is given, then
3131
perform the replacement on all matches of C<$text>.
3232
=end item

0 commit comments

Comments
 (0)