Extract pattern is not working

Status: Closed · Asked by Kenny on · 0 views

Kenny — Question ·

I have a text like this below:

0209.jpeg (https://dl.airtable.com/.attachments/1ebb958a874505f58cf08a24559caf3e/62ed7a45/0209.jpeg)https://dl.airtable.com/.attachments/c62fc1e12e8bda0dd7141ea07c13ac2d/3799d1d4/WhatsAppImage2022-05-21at6.46.34PM.jpeg)

And i want to extract using below regex:
https:\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-])

What is got from the result is like this below:
["https:\/\/dl.airtable.com\/.attachments\/c0fa86539533bd72c33d1d1a4d07b8fc\/fc660906\/0209_result.jpg","dl.airtable.com","\/.attachments\/c0fa86539533bd72c33d1d1a4d07b8fc\/fc660906\/0209_result.jpg"]

From REGEX 101, i got the result i want:

Pabblymember11 — Reply ·

Hey @Kenny

If you want simply want to extract the image URL from the text then you can use "Text Formatter by Pabbly: Text (Basic Formatting)" which will extract the URL for you.

Kenny — Reply ·
Hey @Kenny

If you want simply want to extract the image URL from the text then you can use "Text Formatter by Pabbly: Text (Basic Formatting)" which will extract the URL for you.


I have 3 to 5 urls. Will this work?
Kenny — Reply ·

it looks like this:

How can i perform join array and return the text?

Pabblymember11 — Reply ·

Hey @Kenny

Since you are getting the response in advance the URL is in the array, so you can use the Iterator action step or Line Itemizer action step in your workflow to get it once by one or in commas separated.

Kenny — Reply ·
Hey @Kenny

Since you are getting the response in advance the URL is in the array, so you can use the Iterator action step or Line Itemizer action step in your workflow to get it once by one or in commas separated.


Before i go any further, would you mind telling my why there is discrepancy between Pabbly and Regex101?
Kenny — Reply ·

Line Itemizer does not work

PabblyMember3 — Reply ·

Line Itemizer accepts an array of objects with identical keys. It won't work with the direct array of avlues.

Please pass the array of objects with proper keys as shown in the above screenshot. It will work.

Kenny — Reply ·

So, why i can't extract patterns using text extractor (it shows different results from regex101) ? It will simplify my usecase?

PabblyMember3 — Reply ·

Can you share the string that you are extracting using REGEX and the expected result of the same?

Kenny — Reply ·
Can you share the string that you are extracting using REGEX and the expected result of the same?

Please look at my beginning of this post
PabblyMember3 — Reply ·
Please look at my beginning of this post

Yeah, I got it.
PabblyMember3 — Reply ·

There is a bit difference in the result. Also, I've checked the same https://www.phpliveregex.com/ and it shows a different result.

I would request you try a different REGEX to obtain the expected result.

Back to all forum threads · Log in to reply