-
Notifications
You must be signed in to change notification settings - Fork 61
Regex
Daniele Linguaglossa edited this page Jan 8, 2018
·
1 revision
Regex
is the class used to interact with text and provide a regex-like interface.
Below the list of methods:
Match
is the method used to match a string against a regex it may return true or false, below an example:
// Signature
// Regex.Match(string value, string regex)
function test(base_request) {
var matched = Regex.Match("this is an example!", "[a-z\s!]+")
if(matched) {
// Matched
}
}
matchGroup
unlike Match, matchGroup will return an array of matched groups, below an example:
// Signature
// Regex.Match(string value, string regex)
function test(base_request) {
// Retrive matched groups
var groups = Regex.matchGroup("this is an example!", "(is)")
var is = groups[0];
}