Earth Engine は、共有コンピューティングリソースを保護し、すべてのユーザーに信頼性の高いパフォーマンスを提供するために、
非商用割り当て階層を導入しています。非商用プロジェクトではデフォルトでコミュニティ
ティアが使用されますが、プロジェクトのティアはいつでも変更できます。
Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
ee.String.match
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
文字列を正規表現と照合します。一致する文字列のリストを返します。
| 用途 | 戻り値 |
|---|
String.match(regex, flags) | リスト |
| 引数 | タイプ | 詳細 |
|---|
これ: input | 文字列 | 検索する文字列。 |
regex | 文字列 | 照合する正規表現。 |
flags | 文字列、デフォルト: "" | 正規表現フラグの組み合わせを指定する文字列。具体的には、'g'(グローバル マッチ)または 'i'(大文字と小文字を区別しない)の 1 つ以上。 |
例
コードエディタ(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"
// Use [^] to match any character except a digit.
print(s.match('abc[^0-9]', 'i')); // ["ABCa"]
Python の設定
Python API とインタラクティブな開発での geemap の使用については、
Python 環境のページをご覧ください。
import ee
import geemap.core as geemap
Colab(Python)
s = ee.String('ABCabc123')
display(s.match('')) # ""
display(s.match('ab', 'g')) # ab
display(s.match('ab', 'i')) # AB
display(s.match('AB', 'ig')) # ['AB','ab']
display(s.match('[a-z]+[0-9]+')) # 'abc123'
display(s.match('\\d{2}')) # '12'
# Use [^] to match any character except a digit.
display(s.match('abc[^0-9]', 'i')) # ['ABCa']
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-10-30 UTC。
[null,null,["最終更新日 2025-10-30 UTC。"],[],["The `String.match()` function searches a string (`input`) for matches to a given regular expression (`regex`). It returns a list of matching strings. Optional flags (`flags`) modify the search, such as 'g' for global matching or 'i' for case-insensitive matching. The examples demonstrate various regex patterns and flag combinations. The function returns an empty string if the pattern is empty, or list of matching strings when successful. The examples cover the use case for Javascript and Python.\n"]]