Stay organized with collections
Save and categorize content based on your preferences.
Renames the bands of an image by applying a regular expression replacement to the current band names. Any bands not matched by the regex will be copied over without renaming.
Usage
Returns
Image.regexpRename(regex, replacement, all)
Image
Argument
Type
Details
this: input
Image
The image containing the bands to rename.
regex
String
A regular expression to match in each band name.
replacement
String
The text with which to replace each match. Supports $n syntax for captured values.
all
Boolean, default: true
If true, all matches in a given string will be replaced. Otherwise, only the first match in each string will be replaced.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-13 UTC."],[[["Applies a regular expression to rename image bands, leaving unmatched bands unchanged."],["Offers flexibility to replace all regex matches or only the first match in each band name using the `all` parameter."],["Uses `$n` syntax in the 'replacement' argument to utilize captured values from the regex."],["Operates directly on the provided input image and returns a modified image with the renamed bands."]]],[]]