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 Source string. pattern required const string The regular expression to which this string is to be matched. Return Type
const string Syntax · 2 of 4
str.match(input string source, input string pattern) → input string
Arguments
source required input string Source string. pattern required input string The regular expression to which this string is to be matched. Return Type
input string Syntax · 3 of 4
str.match(simple string source, simple string pattern) → simple string
Arguments
source required simple string Source string. pattern required simple string The regular expression to which this string is to be matched. Return Type
simple string Syntax · 4 of 4
str.match(series string source, series string pattern) → series string
Arguments
source required series string Source string. pattern required series string The regular expression to which this string is to be matched. Return Type
series string Example
//@lipi=2
indicator("String to Number Example", overlay=false)
stringNumber = "123.45"
numericValue = str.tonumber(stringNumber)
plot(numericValue, title="Converted Number", color=color.blue)