Cheddar Documentation
Search…
Cheddar Documentation
Introduction
Syntax
Literals
Mathematics
Variables
Functions
Default Operators
Control Flow
Standard Library
String
Bytes
Count
Length
Match
Slice
Tail
Chars
Head
Lines
Ord
Split
Test
Chunk
Index
Lower
Reverse
Substitute
Upper
Developing
Powered By
GitBook
Match
type
returns
Method
array<string>
Arguments
name
type
description
regex
regex
Regex to match string
Explanation
Returns an array of matched strings. When and if the
g
flag is provided,
.match()
returns all the matches in the string. Regardless of flags,
.match()
will always return a string array.
Examples
"Hello! Hi!"
.
match
(
/
H
.+?!/
)
==
[
"Hello!"
]
"Hello! Hi!"
.
match
(
/
H
.+?!/
g
)
==
[
"Hello!"
,
"Hi!"
]
Previous
Length
Next
Slice
Last modified
1yr ago
Copy link
Outline
Arguments
Explanation
Examples