ee.String.match

Matches a string against a regular expression. Returns a list of matching strings.

UsageReturns
String.match(regex, flags)List
ArgumentTypeDetails
this: inputString

The string in which to search.

regexString

The regular expression to match.

flagsString, default: ""

A string specifying a combination of regular expression flags, specifically one or more of: 'g' (global match) or 'i' (ignore case)

Examples

JavaScript

var s = ee.String('ABCabc123');
print(s.match(''));  // ""
print(s.match('ab', 'g'));  // ab
print(s.match('ab', 'i'));  // AB
print(s.match('AB', 'ig')); // ["AB","ab"]
print(s.match('[a-z]+[0-9]+'));  // "abc123"
print(s.match('\\d{2}'));  // "12"

Python

# Your example goes here!