Make אני רוצה רק את הלינק הראשון, איך מוצאים אותו?

yaellevi8

משתמש פעיל
מנוי פרימיום
בוגר/תלמיד פרוג
עריכה והפקת סרטים
אוטומציה עסקית
היי, אני מחפשת נוסחא לקבל לינק מתוך טקסט שמגיע במייל,
יש לי בתוך הטקסט הזה כמה לינקים, אני רוצה רק את הלינק הראשון, איך מוצאים אותו?
 

rabin

מנהל קהילת אוטומציה
מנהל
מנוי פרימיום
בוגר/תלמיד פרוג
אוטומציה עסקית
היי, אני מחפשת נוסחא לקבל לינק מתוך טקסט שמגיע במייל,
יש לי בתוך הטקסט הזה כמה לינקים, אני רוצה רק את הלינק הראשון, איך מוצאים אותו?
דווקא נוסחה? תלוי במבנה המידע שמגיע.

מצורף דוגמאות:

קוד:
{{get(split(replace(1.emailBody; "/.*?(https?:\/\/\S+)(?:\]|$|\b)|.*/g"; "$1"); newline); 1)}}

קוד:
{{replace(replace(replace(split(1.emailBody; newline)0; "/.*?(https?:\/\/\S+).*|.*[\]\,\-]/g"; "$1"); "]"; emptystring); ","; emptystring)}}
מצורף סינריו באופן אחר לביצוע הפעולה..
קוד:
{
    "subflows": [
        {
            "flow": [
                {
                    "id": 1,
                    "module": "util:SetVariables",
                    "version": 1,
                    "parameters": {},
                    "mapper": {
                        "scope": "roundtrip",
                        "variables": [
                            {
                                "name": "emailBody",
                                "value": "\"שלום,תוכל למצוא פרטים נוספים באתר הבא:\n[https://www.example.com]\nוכן, לרכישת המוצר\n החדש שלנו, הנה הלינק:\nhttps://www.example.com/productבברכה,\nצוות המכירות\""
                            }
                        ]
                    },
                    "metadata": {
                        "designer": {
                            "x": -918,
                            "y": -309
                        },
                        "restore": {
                            "expect": {
                                "scope": {
                                    "label": "One cycle"
                                },
                                "variables": {
                                    "items": [
                                        null
                                    ]
                                }
                            }
                        },
                        "expect": [
                            {
                                "name": "variables",
                                "spec": [
                                    {
                                        "name": "name",
                                        "type": "text",
                                        "label": "Variable name",
                                        "required": true
                                    },
                                    {
                                        "name": "value",
                                        "type": "any",
                                        "label": "Variable value"
                                    }
                                ],
                                "type": "array",
                                "label": "Variables"
                            },
                            {
                                "name": "scope",
                                "type": "select",
                                "label": "Variable lifetime",
                                "required": true,
                                "validate": {
                                    "enum": [
                                        "roundtrip",
                                        "execution"
                                    ]
                                }
                            }
                        ],
                        "interface": [
                            {
                                "name": "emailBody",
                                "type": "any",
                                "label": "emailBody"
                            }
                        ]
                    }
                },
                {
                    "id": 2,
                    "module": "regexp:GetElementsFromText",
                    "version": 1,
                    "parameters": {
                        "continueWhenNoRes": false
                    },
                    "mapper": {
                        "text": "{{1.emailBody}}",
                        "pattern": "##http_urls",
                        "requireProtocol": true,
                        "specialCharsPattern": ""
                    },
                    "metadata": {
                        "designer": {
                            "x": -622,
                            "y": -304
                        },
                        "restore": {
                            "expect": {
                                "pattern": {
                                    "label": "HTTP address"
                                }
                            }
                        },
                        "parameters": [
                            {
                                "name": "continueWhenNoRes",
                                "type": "boolean",
                                "label": "Continue the execution of the route even if the module finds no matches",
                                "required": true
                            }
                        ],
                        "expect": [
                            {
                                "name": "pattern",
                                "type": "select",
                                "label": "Pattern",
                                "required": true,
                                "validate": {
                                    "enum": [
                                        "##emails",
                                        "##html_tags",
                                        "##http_urls",
                                        "##ftp_urls",
                                        "##telephone_numbers",
                                        "##ipv4",
                                        "##ipv6",
                                        "##emoji",
                                        "##key_value_pairs"
                                    ]
                                }
                            },
                            {
                                "name": "text",
                                "type": "text",
                                "label": "Text",
                                "required": true
                            },
                            {
                                "name": "requireProtocol",
                                "type": "boolean",
                                "label": "Full addresses",
                                "required": true
                            },
                            {
                                "name": "specialCharsPattern",
                                "type": "text",
                                "label": "Special characters in the pattern"
                            }
                        ],
                        "interface": [
                            {
                                "name": "match",
                                "type": "any",
                                "label": "Match"
                            }
                        ]
                    }
                },
                {
                    "id": 3,
                    "module": "util:SetVariable2",
                    "version": 1,
                    "parameters": {},
                    "mapper": {
                        "name": "2",
                        "scope": "roundtrip",
                        "value": "{{2.match}}"
                    },
                    "metadata": {
                        "designer": {
                            "x": -314,
                            "y": -304
                        },
                        "restore": {
                            "expect": {
                                "scope": {
                                    "label": "One cycle"
                                }
                            }
                        },
                        "expect": [
                            {
                                "name": "name",
                                "type": "text",
                                "label": "Variable name",
                                "required": true
                            },
                            {
                                "name": "scope",
                                "type": "select",
                                "label": "Variable lifetime",
                                "required": true,
                                "validate": {
                                    "enum": [
                                        "roundtrip",
                                        "execution"
                                    ]
                                }
                            },
                            {
                                "name": "value",
                                "type": "any",
                                "label": "Variable value"
                            }
                        ],
                        "interface": [
                            {
                                "name": "2",
                                "label": "2",
                                "type": "any"
                            }
                        ]
                    }
                }
            ]
        }
    ],
    "metadata": {
        "version": 1
    }
}
 

אולי מעניין אותך גם...

הפרק היומי

הפרק היומי! כל ערב פרק תהילים חדש. הצטרפו אלינו לקריאת תהילים משותפת!


תהילים פרק קמט

א הַלְלוּיָהּ שִׁירוּ לַיהוָה שִׁיר חָדָשׁ תְּהִלָּתוֹ בִּקְהַל חֲסִידִים:ב יִשְׂמַח יִשְׂרָאֵל בְּעֹשָׂיו בְּנֵי צִיּוֹן יָגִילוּ בְמַלְכָּם:ג יְהַלְלוּ שְׁמוֹ בְמָחוֹל בְּתֹף וְכִנּוֹר יְזַמְּרוּ לוֹ:ד כִּי רוֹצֶה יְהוָה בְּעַמּוֹ יְפָאֵר עֲנָוִים בִּישׁוּעָה:ה יַעְלְזוּ חֲסִידִים בְּכָבוֹד יְרַנְּנוּ עַל מִשְׁכְּבוֹתָם:ו רוֹמְמוֹת אֵל בִּגְרוֹנָם וְחֶרֶב פִּיפִיּוֹת בְּיָדָם:ז לַעֲשׂוֹת נְקָמָה בַּגּוֹיִם תּוֹכֵחֹת בַּלְאֻמִּים:ח לֶאְסֹר מַלְכֵיהֶם בְּזִקִּים וְנִכְבְּדֵיהֶם בְּכַבְלֵי בַרְזֶל:ט לַעֲשׂוֹת בָּהֶם מִשְׁפָּט כָּתוּב הָדָר הוּא לְכָל חֲסִידָיו הַלְלוּיָהּ:
נקרא  6  פעמים

ספירת העומר

לוח מודעות

למעלה