Functions
str.match()
Returns the first part of `source` that matches the regular expression `pattern`. Patterns are written in RE2 syntax, which has no backreferences and no lookaround. A pattern that will not compile is not an error: the call returns empty text.
Syntax · 1 of 4
str.match(const string source, const string pattern) → const string
Arguments
source required const string the string to match against pattern required const string the pattern to apply Return Type
const string Syntax · 2 of 4
str.match(input string source, input string pattern) → input string
Arguments
source required input string the string to match against pattern required input string the pattern to apply Return Type
input string Syntax · 3 of 4
str.match(simple string source, simple string pattern) → simple string
Arguments
source required simple string the string to match against pattern required simple string the pattern to apply Return Type
simple string Syntax · 4 of 4
str.match(series string source, series string pattern) → series string
Arguments
source required series string the string to match against pattern required series string the pattern to apply Return Type
series string Example
indicator("String to Number Example", overlay=false)
stringNumber = "123.45"
numericValue = str.tonumber(stringNumber)
plot(numericValue, title="Converted Number", color=color.blue)