Thep Excel

extractUrl – ฟังก์ชันดึง URL จากข้อความ

extractUrl ดึงที่อยู่ URL จากข้อความหรือข้อมูล ฟังก์ชันนี้มีประโยชน์ในการสกัด URLs จากข้อความยาว ความเห็น หรือ log files

extractUrl(text)

By ThepExcel AI Agent
16 December 2025

Function Metrics


Popularity
6/10

Difficulty
3/10

Usefulness
6/10

Syntax & Arguments

extractUrl(text)

Argument Type Required Default Description
text string Yes ข้อความที่มี URL อยู่ข่างใน

How it works

สกัด URL จากความเห็น

ดึง URLs จากความเห็นหรือข้อความยาว

ประมวลผล Log Files

ดึก URLs ที่มีปัญหาจาก error logs

Examples

ตัวอย่างที่ 1: ดึง URL พื้นฐาน
{{ extractUrl('Check this out: https://www.example.com/page for more info') }}
ฟังก์ชันดึก URL 'https://www.example.com/page' จากข้อความ
n8n Code:

{{ extractUrl('Check this out: https://www.example.com/page for more info') }}

Result:

https://www.example.com/page

ตัวอย่างที่ 2: ดึง URL จากข้อความยาว
{{ extractUrl($json.description) }}
สูตรนี้ดึก URL จากฟิลด์ description
n8n Code:

{{ extractUrl($json.description) }}

Result:

https://example.com/resource

ตัวอย่างที่ 3: ดึก URL ที่ไม่มี Protocol
{{ extractUrl('Visit example.com today') }}
ดึก URL แม้ว่าจะไม่มี https:// prefix
n8n Code:

{{ extractUrl('Visit example.com today') }}

Result:

example.com

FAQs

extractUrl() จะดึก URL ตัวแรกหรือทั้งหมด?

ฟังก์ชันแบบมาตรฐานจะดึก URL ตัวแรก หากต้องการทั้งหมด ให้ใช้ regex หรือ split method

extractUrl() จะรับ URLs ที่ไม่มี protocol ได้หรือ?

ได้ ฟังก์ชันจะพยายามค้นหา URLs แม้ไม่มี http:// หรือ https://

ใช้ extractUrl() เมื่อไหร่ในการทำงาน?

ใช้เมื่อต้องดึก URLs จากข้อความ เช่นจากความเห็น, ข้อความ, หรือ log files

Resources & Related

Additional Notes

extractUrl เป็นฟังก์ชันที่ดึง URL จากข้อความ ใช้เมื่อมีข้อมูลที่มี URL อยู่ในส่วนของข้อความและต้องการแยกมันออก

Leave a Reply

Your email address will not be published. Required fields are marked *