ee.Image.regexpRename
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
เปลี่ยนชื่อแถบของรูปภาพโดยใช้การแทนที่นิพจน์ทั่วไปกับชื่อแถบปัจจุบัน ระบบจะคัดลอกวงดนตรีที่ไม่ตรงกับนิพจน์ทั่วไปโดยไม่เปลี่ยนชื่อ
การใช้งาน | การคืนสินค้า |
---|
Image.regexpRename(regex, replacement, all) | รูปภาพ |
อาร์กิวเมนต์ | ประเภท | รายละเอียด |
---|
ดังนี้ input | รูปภาพ | รูปภาพที่มีแถบที่จะเปลี่ยนชื่อ |
regex | สตริง | นิพจน์ทั่วไปที่ตรงกับชื่อวงดนตรีแต่ละชื่อ |
replacement | สตริง | ข้อความที่จะใช้แทนที่แต่ละรายการที่ตรงกัน รองรับไวยากรณ์ $n สำหรับค่าที่บันทึก |
all | บูลีน ค่าเริ่มต้น: จริง | หากเป็นจริง ระบบจะแทนที่รายการที่ตรงกันทั้งหมดในสตริงที่ระบุ ไม่เช่นนั้น ระบบจะแทนที่เฉพาะส่วนที่ตรงกันที่พบก่อนในแต่ละสตริง |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[[["\u003cp\u003eApplies a regular expression to rename image bands, leaving unmatched bands unchanged.\u003c/p\u003e\n"],["\u003cp\u003eOffers flexibility to replace all regex matches or only the first match in each band name using the \u003ccode\u003eall\u003c/code\u003e parameter.\u003c/p\u003e\n"],["\u003cp\u003eUses \u003ccode\u003e$n\u003c/code\u003e syntax in the 'replacement' argument to utilize captured values from the regex.\u003c/p\u003e\n"],["\u003cp\u003eOperates directly on the provided input image and returns a modified image with the renamed bands.\u003c/p\u003e\n"]]],["This functionality renames image bands using regular expressions. It takes an image, a `regex` to match band names, and a `replacement` string (supporting captured groups via `$n`). Bands not matching the `regex` remain unchanged. An optional `all` parameter (defaulting to `true`) determines whether to replace all regex matches or just the first one per band name. The function returns a new image with the updated band names.\n"],null,["# ee.Image.regexpRename\n\nRenames 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.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|---------------------------------------------------|---------|\n| Image.regexpRename`(regex, replacement, `*all*`)` | Image |\n\n| Argument | Type | Details |\n|---------------|------------------------|---------------------------------------------------------------------------------------------------------------------------|\n| this: `input` | Image | The image containing the bands to rename. |\n| `regex` | String | A regular expression to match in each band name. |\n| `replacement` | String | The text with which to replace each match. Supports $n syntax for captured values. |\n| `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. |"]]